Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-12-25 14:43:26 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-12-25 14:43:26 +0400
commit122e2b4bfa0211676042ba8e02570d1dcd2fc40d (patch)
tree109eb665c67d559d9f5a815f358f9e4f553c65c1 /source/blender/blenkernel/BKE_library.h
parentad0a3de3ce7f84486047b11343405072f0972107 (diff)
Fix T37709: Memory corruption when freeing custom bone shape objects
Summary: Issue was caused by access to pchan->custom object from channel free function when freeing all objects from main. Order of objects free is not defined and such an access might easily end up with access to freed memory. We don't need to do user counter stuff when freeing main, so added an _ex functions with do_id_user flag which is used when freeing main. We had the same issue with other datablocks, so now it should be easier to support relevant user counter. This issue was caused by the fix for T36391, so perhaps that's indeed high time to do real user counter. Reviewers: brecht, campbellbarton Reviewed By: campbellbarton Maniphest Tasks: T37709 Differential Revision: https://developer.blender.org/D137
Diffstat (limited to 'source/blender/blenkernel/BKE_library.h')
-rw-r--r--source/blender/blenkernel/BKE_library.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h
index b8da5002d84..f97bb911a12 100644
--- a/source/blender/blenkernel/BKE_library.h
+++ b/source/blender/blenkernel/BKE_library.h
@@ -74,6 +74,7 @@ struct ListBase *which_libbase(struct Main *mainlib, short type);
int set_listbasepointers(struct Main *main, struct ListBase **lb);
void BKE_libblock_free(struct ListBase *lb, void *idv);
+void BKE_libblock_free_ex(struct ListBase *lb, void *idv, bool do_id_user);
void BKE_libblock_free_us(struct ListBase *lb, void *idv);
void BKE_libblock_free_data(struct ID *id);
void free_main(struct Main *mainvar);