wip: attempt to fix yoga ASAN crash by clearing context pointer

Still investigating heap-use-after-free issue during GC cleanup
This commit is contained in:
Claude Bot
2025-08-30 04:10:01 +00:00
parent ae4e3d4afe
commit 583f5d65d8

View File

@@ -21,11 +21,15 @@ JSYogaNode::JSYogaNode(JSC::VM& vm, JSC::Structure* structure)
JSYogaNode::~JSYogaNode()
{
if (m_node) {
// Clear the context pointer to avoid callbacks during cleanup
YGNodeSetContext(m_node, nullptr);
// Remove from parent to avoid use-after-free when parent tries to clear owner
YGNodeRef parent = YGNodeGetParent(m_node);
if (parent) {
YGNodeRemoveChild(parent, m_node);
}
YGNodeFree(m_node);
clearInternal();
}