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:
authorCampbell Barton <campbell@blender.org>2022-08-30 12:24:45 +0300
committerCampbell Barton <campbell@blender.org>2022-08-30 12:41:48 +0300
commita97ae83a09e0a67168f1d3cdcbafd5b1ff16e3c9 (patch)
tree8d32f23e4d9a1eacf3f8a42514de6926b39c238b
parent16938ab7d4956a1cb6a3501a0c0671ac56ba781e (diff)
Fix T100703: Crash in file reading with ID's referenced from the WM
Don't decrement ID reference counts as any ID references from the window-managers will have already been freed. Reviewed By: mont29 Ref D15808
-rw-r--r--source/blender/windowmanager/intern/wm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c
index 0d74bc259f4..2500d72c850 100644
--- a/source/blender/windowmanager/intern/wm.c
+++ b/source/blender/windowmanager/intern/wm.c
@@ -610,7 +610,10 @@ void wm_close_and_free_all(bContext *C, ListBase *wmlist)
while ((wm = wmlist->first)) {
wm_close_and_free(C, wm);
BLI_remlink(wmlist, wm);
- BKE_libblock_free_data(&wm->id, true);
+ /* Don't handle user counts as this is only ever called once #G_MAIN has already been freed via
+ * #BKE_main_free so any ID's referenced by the window-manager (from ID properties) will crash.
+ * See: T100703. */
+ BKE_libblock_free_data(&wm->id, false);
BKE_libblock_free_data_py(&wm->id);
MEM_freeN(wm);
}