[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [22789] branches/soc-2008-mxcurioni/source : Made an attempt to fix a crash due to undo.

Tamito Kajiyama rd6t-kjym at asahi-net.or.jp
Wed Aug 26 01:46:01 CEST 2009


Revision: 22789
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22789
Author:   kjym3
Date:     2009-08-26 01:46:00 +0200 (Wed, 26 Aug 2009)

Log Message:
-----------
Made an attempt to fix a crash due to undo.  An undo invalidated
some Freestyle-related pointers, which led to a crash when the
rendering was initiated or the Freestyle panel (in the Scene buttons)
was redrawn.

Modified Paths:
--------------
    branches/soc-2008-mxcurioni/source/blender/freestyle/FRS_freestyle.h
    branches/soc-2008-mxcurioni/source/blender/src/editscreen.c
    branches/soc-2008-mxcurioni/source/blender/src/space.c
    branches/soc-2008-mxcurioni/source/blender/src/usiblender.c
    branches/soc-2008-mxcurioni/source/creator/creator.c

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/FRS_freestyle.h
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/FRS_freestyle.h	2009-08-25 23:39:49 UTC (rev 22788)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/FRS_freestyle.h	2009-08-25 23:46:00 UTC (rev 22789)
@@ -27,7 +27,7 @@
 	
 	// Rendering
 	void FRS_initialize();
-	void FRS_add_Freestyle(Render* re);
+	void FRS_add_Freestyle(struct Render* re);
 	void FRS_exit();
 	
 	// Panel configuration

Modified: branches/soc-2008-mxcurioni/source/blender/src/editscreen.c
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/src/editscreen.c	2009-08-25 23:39:49 UTC (rev 22788)
+++ branches/soc-2008-mxcurioni/source/blender/src/editscreen.c	2009-08-25 23:46:00 UTC (rev 22789)
@@ -108,6 +108,8 @@
 #include "BPY_extern.h"
 #endif
 
+#include "FRS_freestyle.h"
+
 #include "mydevice.h"
 #include "blendef.h"
 
@@ -1380,6 +1382,7 @@
 		else if (event==LOAD_FILE) {
 			BIF_read_file(ext_load_str);
 			sound_initialize_sounds();
+			FRS_initialize();
 		}
 #ifndef DISABLE_PYTHON
 		else if ((event==ONLOAD_SCRIPT) && BPY_has_onload_script()) {

Modified: branches/soc-2008-mxcurioni/source/blender/src/space.c
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/src/space.c	2009-08-25 23:39:49 UTC (rev 22788)
+++ branches/soc-2008-mxcurioni/source/blender/src/space.c	2009-08-25 23:46:00 UTC (rev 22789)
@@ -189,6 +189,8 @@
 #include "GPU_extensions.h"
 #include "GPU_draw.h"
 
+#include "FRS_freestyle.h"
+
 #include "BLO_sys_types.h" // for intptr_t support
 
 /* maybe we need this defined somewhere else */
@@ -1086,6 +1088,7 @@
 #endif
 				BKE_undo_step(1);
 				sound_initialize_sounds();
+				FRS_initialize();
 			}
 		}
 	}
@@ -1109,6 +1112,7 @@
 			if(U.uiflag & USER_GLOBALUNDO) {
 				BKE_undo_step(-1);
 				sound_initialize_sounds();
+				FRS_initialize();
 			}
 		}
 	}
@@ -1132,6 +1136,7 @@
 				if(event>0) {
 					BKE_undo_number(event);
 					sound_initialize_sounds();
+					FRS_initialize();
 				}
 			}
 		}

Modified: branches/soc-2008-mxcurioni/source/blender/src/usiblender.c
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/src/usiblender.c	2009-08-25 23:39:49 UTC (rev 22788)
+++ branches/soc-2008-mxcurioni/source/blender/src/usiblender.c	2009-08-25 23:46:00 UTC (rev 22789)
@@ -598,6 +598,7 @@
 		mainwindow_set_filename_to_title(G.main->name);
 		countall();
 		sound_initialize_sounds();
+		FRS_initialize();
 
 		winqueue_break= 1;	/* leave queues everywhere */
 
@@ -605,8 +606,6 @@
 		
 		if (retval!=0) G.relbase_valid = 1;
 
-		FRS_initialize();
-
 		undo_editmode_clear();
 		undo_imagepaint_clear();
 		BKE_reset_undo();

Modified: branches/soc-2008-mxcurioni/source/creator/creator.c
===================================================================
--- branches/soc-2008-mxcurioni/source/creator/creator.c	2009-08-25 23:39:49 UTC (rev 22788)
+++ branches/soc-2008-mxcurioni/source/creator/creator.c	2009-08-25 23:46:00 UTC (rev 22789)
@@ -817,13 +817,12 @@
 			if (G.background) {
 				int retval = BKE_read_file(filename, NULL);
 				sound_initialize_sounds();
+				FRS_initialize();
 				
 				/*we successfully loaded a blend file, get sure that
 				pointcache works */
 				if (retval!=0) G.relbase_valid = 1;
 
-				FRS_initialize();
-
 				/* happens for the UI on file reading too */
 				BKE_reset_undo();
 				BKE_write_undo("original");	/* save current state */





More information about the Bf-blender-cvs mailing list