Fix: dangling pointer caused use-after-free
The old code only worked when built-in nodes are only unregistered at most once while Blender is running. However, this is not the case when running certain unit tests such as `AbstractHierarchy*` in `blender_test`. Found by Sybren, thanks.
This commit is contained in:
parent
ef7e21fd4a
commit
dd689eeda4
|
@ -1380,6 +1380,7 @@ static void node_free_type(void *nodetype_v)
|
|||
}
|
||||
|
||||
delete nodetype->fixed_declaration;
|
||||
nodetype->fixed_declaration = nullptr;
|
||||
|
||||
/* Can be null when the type is not dynamically allocated. */
|
||||
if (nodetype->free_self) {
|
||||
|
|
Loading…
Reference in New Issue