Depsgraph: Fix memory leak when datablock is not reused
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 20 Mar 2018 15:06:21 +0000 (16:06 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 20 Mar 2018 15:07:27 +0000 (16:07 +0100)
It is possible that datablock will not be re-used for the new
dependency graph building. Freeing function was freeing all
the nested pointers of databnlock, but not datablock memory
itself.

source/blender/depsgraph/intern/builder/deg_builder_nodes.cc

index bbf28a98aa24ca0603b3164a7a04c62a3e5aad81..80daa306bffd9638013793d6b97ef6eed386f6fb 100644 (file)
@@ -155,6 +155,7 @@ void free_copy_on_write_datablock(void *id_v)
 {
        ID *id = (ID *)id_v;
        deg_free_copy_on_write_datablock(id);
+       MEM_freeN(id);
 }
 
 }  /* namespace */