[Bf-blender-cvs] [648df0fcdb8] blender2.8: Revert "BKE: Changing ID freeing order."

Campbell Barton noreply at git.blender.org
Thu Feb 22 05:09:07 CET 2018


Commit: 648df0fcdb8249d8d00ee501d6947216bb7330d5
Author: Campbell Barton
Date:   Thu Feb 22 15:10:43 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB648df0fcdb8249d8d00ee501d6947216bb7330d5

Revert "BKE: Changing ID freeing order."

This reverts commit 87c72a7d2714de286109573055d5d5da32ece91e.

Caused T54121 which breaks blend file saving.
For now crash on exit is preferable.
Possible solution is to free screen-manipulator batches in a separate
loop.

===================================================================

M	source/blender/blenkernel/intern/library.c
M	source/blender/makesdna/DNA_ID.h
M	source/blender/windowmanager/intern/wm_init_exit.c

===================================================================

diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 6169263b7cf..e0608efece2 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -1067,8 +1067,6 @@ int set_listbasepointers(Main *main, ListBase **lb)
 	 * This is important because freeing data decreases usercounts of other datablocks,
 	 * if this data is its self freed it can crash. */
 	lb[INDEX_ID_LI] = &(main->library);  /* Libraries may be accessed from pretty much any other ID... */
-	lb[INDEX_ID_WS]  = &(main->workspaces); /* before wm, so it's freed after it! */
-	lb[INDEX_ID_WM]  = &(main->wm);
 	lb[INDEX_ID_IP] = &(main->ipo);
 	lb[INDEX_ID_AC] = &(main->action); /* moved here to avoid problems when freeing with animato (aligorith) */
 	lb[INDEX_ID_KE] = &(main->key);
@@ -1110,6 +1108,8 @@ int set_listbasepointers(Main *main, ListBase **lb)
 	lb[INDEX_ID_OB]  = &(main->object);
 	lb[INDEX_ID_LS]  = &(main->linestyle); /* referenced by scenes */
 	lb[INDEX_ID_SCE] = &(main->scene);
+	lb[INDEX_ID_WS]  = &(main->workspaces); /* before wm, so it's freed after it! */
+	lb[INDEX_ID_WM]  = &(main->wm);
 	lb[INDEX_ID_MSK] = &(main->mask);
 	
 	lb[INDEX_ID_NULL] = NULL;
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index ffa09a21944..fd8cd8b2855 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -519,8 +519,6 @@ enum {
  * keep them in sync! */
 enum {
 	INDEX_ID_LI = 0,
-	INDEX_ID_WS,
-	INDEX_ID_WM,
 	INDEX_ID_IP,
 	INDEX_ID_AC,
 	INDEX_ID_KE,
@@ -553,6 +551,8 @@ enum {
 	INDEX_ID_OB,
 	INDEX_ID_LS,
 	INDEX_ID_SCE,
+	INDEX_ID_WS,
+	INDEX_ID_WM,
 	INDEX_ID_MSK,
 	INDEX_ID_NULL,
 };
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index 8465ec1c608..adb03de4612 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -521,17 +521,6 @@ void WM_exit_ext(bContext *C, const bool do_python)
 	COM_deinitialize();
 #endif
 	
-	if (!G.background) {
-#ifdef WITH_OPENSUBDIV
-		BKE_subsurf_osd_cleanup();
-#endif
-
-		GPU_global_buffer_pool_free();
-		GPU_free_unused_buffers();
-
-		GPU_exit();
-	}
-
 	BKE_blender_free();  /* blender.c, does entire library and spacetypes */
 //	free_matcopybuf();
 	ANIM_fcurves_copybuf_free();
@@ -576,6 +565,17 @@ void WM_exit_ext(bContext *C, const bool do_python)
 	(void)do_python;
 #endif
 
+	if (!G.background) {
+#ifdef WITH_OPENSUBDIV
+		BKE_subsurf_osd_cleanup();
+#endif
+
+		GPU_global_buffer_pool_free();
+		GPU_free_unused_buffers();
+
+		GPU_exit();
+	}
+
 	BKE_undo_reset();
 	
 	ED_file_exit(); /* for fsmenu */



More information about the Bf-blender-cvs mailing list