diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-12-26 01:57:44 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-12-26 01:57:44 +0400 |
commit | d9e0a9467503dc6cd004c67a118d315f2238f3b0 (patch) | |
tree | 56297f0f8314010437b427615ecd553ee6d396ef /source | |
parent | ca3609126624a937c493f187c94289c9676f20dd (diff) |
Fix T37939: Crash on exit (reading from freed node trees)
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/library.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/node.c | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 95f1cce38e3..910ab0ffe1b 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -950,7 +950,7 @@ void BKE_libblock_free_ex(ListBase *lb, void *idv, bool do_id_user) BKE_action_free((bAction *)id); break; case ID_NT: - ntreeFreeTree((bNodeTree *)id); + ntreeFreeTree_ex((bNodeTree *)id, do_id_user); break; case ID_BR: BKE_brush_free((Brush *)id); diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index d0ce56332a7..977aa016d2e 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -1714,8 +1714,11 @@ void ntreeFreeTree_ex(bNodeTree *ntree, const short do_id_user) } } - /* XXX not nice, but needed to free localized node groups properly */ - free_localized_node_groups(ntree); + /* when freeing main, this would check other ntree's which may have been freed, see [#37939] */ + if (do_id_user) { + /* XXX not nice, but needed to free localized node groups properly */ + free_localized_node_groups(ntree); + } /* unregister associated RNA types */ ntreeInterfaceTypeFree(ntree); |