-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Description
I have this issue in js bindings in [email protected].
If we have a tree-like structure and call freeRecursive on a node, updating measure function on children will cause memory errors, depending on memory content it can be:
- null function or function signature mismatch
- out of memory
- memory access out of bounds
Here's a quick repro:
import {loadYoga} from 'yoga-layout/load';
const yoga = await loadYoga();
const root = yoga.Node.create();
const node1 = yoga.Node.create();
const node2 = yoga.Node.create();
root.insertChild(node1, 0)
node1.insertChild(node2, 0)
node2.setMeasureFunc(() => {
return {
width: 100,
height: 100,
};
})
node1.freeRecursive();
node2.setMeasureFunc(() => {
return {
width: 100,
height: 100,
};
})I understand that this is not a good to free memory and then try to use it again, but maybe we can add some checks in the js bindings code?
Metadata
Metadata
Assignees
Labels
No labels