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:
@@ -1380,6 +1380,7 @@ static void node_free_type(void *nodetype_v)
|
|||||||
}
|
}
|
||||||
|
|
||||||
delete nodetype->fixed_declaration;
|
delete nodetype->fixed_declaration;
|
||||||
|
nodetype->fixed_declaration = nullptr;
|
||||||
|
|
||||||
/* Can be null when the type is not dynamically allocated. */
|
/* Can be null when the type is not dynamically allocated. */
|
||||||
if (nodetype->free_self) {
|
if (nodetype->free_self) {
|
||||||
|
Reference in New Issue
Block a user