Depsgrpah: Fix crash when removing object

This commit is contained in:
2017-10-18 16:43:40 +02:00
parent 47bcd4abad
commit 651f76b384

View File

@@ -309,6 +309,7 @@ IDDepsNode *Depsgraph::add_id_node(ID *id, bool do_tag, ID *id_cow_hint)
void Depsgraph::clear_id_nodes()
{
if (use_copy_on_write) {
/* Stupid workaround to ensure we free IDs in a proper order. */
GHASH_FOREACH_BEGIN(IDDepsNode *, id_node, id_hash)
{
@@ -327,6 +328,7 @@ void Depsgraph::clear_id_nodes()
}
}
GHASH_FOREACH_END();
}
GHASH_FOREACH_BEGIN(IDDepsNode *, id_node, id_hash)
{
OBJECT_GUARDED_DELETE(id_node, IDDepsNode);