[Bf-blender-cvs] [31efc624dc1] greasepencil-object: Fix: Palettes were getting freed before GPencil datablocks on exit

Joshua Leung noreply at git.blender.org
Wed Oct 4 23:02:36 CEST 2017


Commit: 31efc624dc1ce899a3a4782f3c6c7f03166f7157
Author: Joshua Leung
Date:   Thu Oct 5 10:00:23 2017 +1300
Branches: greasepencil-object
https://developer.blender.org/rB31efc624dc1ce899a3a4782f3c6c7f03166f7157

Fix: Palettes were getting freed before GPencil datablocks on exit

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

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

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

diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 71fbb3d726a..504033ef998 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -986,6 +986,7 @@ int set_listbasepointers(Main *main, ListBase **lb)
 	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);
+	lb[INDEX_ID_PAL] = &(main->palettes); /* referenced by gpencil, so needs to be before that to avoid crashes */
 	lb[INDEX_ID_GD] = &(main->gpencil); /* referenced by nodes, objects, view, scene etc, before to free after. */
 	lb[INDEX_ID_NT] = &(main->nodetree);
 	lb[INDEX_ID_IM] = &(main->image);
@@ -1011,7 +1012,6 @@ int set_listbasepointers(Main *main, ListBase **lb)
 	lb[INDEX_ID_TXT] = &(main->text);
 	lb[INDEX_ID_SO]  = &(main->sound);
 	lb[INDEX_ID_GR]  = &(main->group);
-	lb[INDEX_ID_PAL] = &(main->palettes);
 	lb[INDEX_ID_PC]  = &(main->paintcurves);
 	lb[INDEX_ID_BR]  = &(main->brush);
 	lb[INDEX_ID_PA]  = &(main->particle);
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index 4ea5b8761b9..998482741d1 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -421,6 +421,7 @@ enum {
 	INDEX_ID_IP,
 	INDEX_ID_AC,
 	INDEX_ID_KE,
+	INDEX_ID_PAL,
 	INDEX_ID_GD,
 	INDEX_ID_NT,
 	INDEX_ID_IM,
@@ -438,7 +439,6 @@ enum {
 	INDEX_ID_TXT,
 	INDEX_ID_SO,
 	INDEX_ID_GR,
-	INDEX_ID_PAL,
 	INDEX_ID_PC,
 	INDEX_ID_BR,
 	INDEX_ID_PA,



More information about the Bf-blender-cvs mailing list