Skip to content

Commit 8eaa93f

Browse files
authored
Update VariablesUtils.js
1 parent 01bb74d commit 8eaa93f

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

newIDE/app/src/Utils/VariablesUtils.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,19 @@ export const hasChildThatContainsStringInNameOrValue = (
4848
* variables container: the intersection of the variables of all the objects
4949
* of the group, with "mixed values"/"mixed types" markers when they differ
5050
* between objects.
51-
*
52-
* `gd.ObjectRefactorer.mergeVariableContainers` returns a `VariablesContainer`
53-
* "by value", which means the same C++ instance is shared by every call (it's
54-
* stored in a static variable by the bindings). Keeping it in an editor is
55-
* unsafe: any other call (from another editor, an AI editor function, etc.)
56-
* would overwrite it, making the variables being edited seemingly "reset" to
57-
* their previous state. This helper copies the merged result into a new
58-
* container owned by the caller - which must call `delete` on it when done,
59-
* to free the C++ memory.
6051
*/
6152
export const makeObjectGroupMergedVariablesContainer = (
6253
objectsContainersList: gdObjectsContainersList,
6354
objectGroup: gdObjectGroup
6455
): gdVariablesContainer => {
56+
57+
// `gd.ObjectRefactorer.mergeVariableContainers` returns a `VariablesContainer`
58+
// "by value", which means the same C++ instance is shared by every call (it's
59+
// stored in a static variable by the bindings). Keeping it in an editor is
60+
// unsafe: any other call (from another editor, an AI editor function, etc.)
61+
// would overwrite it. This helper copies the merged result into a new
62+
// container owned by the caller - which must call `delete` on it when done,
63+
// to free the C++ memory.
6564
const sharedMergedVariablesContainer = gd.ObjectRefactorer.mergeVariableContainers(
6665
objectsContainersList,
6766
objectGroup

0 commit comments

Comments
 (0)