[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58751] branches/soc-2013-viewport_fx: fixed crash at shutdown caused by de-initializing GPU stuff after windows had been destroyed

Jason Wilkins Jason.A.Wilkins at gmail.com
Wed Jul 31 04:32:01 CEST 2013


Revision: 58751
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58751
Author:   jwilkins
Date:     2013-07-31 02:32:00 +0000 (Wed, 31 Jul 2013)
Log Message:
-----------
fixed crash at shutdown caused by de-initializing GPU stuff after windows had been destroyed

This makes me concerned about contexts and de-initialization.  I think it will work OK as long as contexts share 'display lists', but there might still be some race conditions caused by resources being managed separately from the windows they are associated with...

Modified Paths:
--------------
    branches/soc-2013-viewport_fx/intern/ghost/intern/GHOST_Context.h
    branches/soc-2013-viewport_fx/source/blender/windowmanager/intern/wm_init_exit.c

Modified: branches/soc-2013-viewport_fx/intern/ghost/intern/GHOST_Context.h
===================================================================
--- branches/soc-2013-viewport_fx/intern/ghost/intern/GHOST_Context.h	2013-07-31 01:10:34 UTC (rev 58750)
+++ branches/soc-2013-viewport_fx/intern/ghost/intern/GHOST_Context.h	2013-07-31 02:32:00 UTC (rev 58751)
@@ -143,7 +143,4 @@
 
 
 
-
-
-
 #endif // __GHOST_CONTEXT_H__

Modified: branches/soc-2013-viewport_fx/source/blender/windowmanager/intern/wm_init_exit.c
===================================================================
--- branches/soc-2013-viewport_fx/source/blender/windowmanager/intern/wm_init_exit.c	2013-07-31 01:10:34 UTC (rev 58750)
+++ branches/soc-2013-viewport_fx/source/blender/windowmanager/intern/wm_init_exit.c	2013-07-31 02:32:00 UTC (rev 58751)
@@ -136,7 +136,6 @@
 /* only called once, for startup */
 void WM_init(bContext *C, int argc, const char **argv)
 {
-	
 	if (!G.background) {
 		wm_ghost_init(C);   /* note: it assigns C to ghost! */
 		wm_init_cursor_data();
@@ -420,6 +419,20 @@
 		wmWindow *win;
 
 		if (!G.background) {
+			GPU_global_buffer_pool_free();
+			GPU_free_unused_buffers();
+			GPU_extensions_exit();
+
+			gpuShutdownLighting();
+
+			gpuDeleteIndex(gindex);
+			gpuImmediateIndex(NULL);
+
+			gpuImmediateMakeCurrent(NULL);
+			gpuDeleteImmediate(immediate);
+
+			GPU_ms_exit();
+
 			if ((U.uiflag2 & USER_KEEP_SESSION) || BKE_undo_valid(NULL)) {
 				/* save the undo state as quit.blend */
 				char filename[FILE_MAX];
@@ -514,21 +527,6 @@
 	(void)do_python;
 #endif
 
-	GPU_global_buffer_pool_free();
-	GPU_free_unused_buffers();
-	GPU_extensions_exit();
-
-
-		gpuShutdownLighting();
-
-		gpuDeleteIndex(gindex);
-		gpuImmediateIndex(NULL);
-
-		gpuImmediateMakeCurrent(NULL);
-		gpuDeleteImmediate(immediate);
-
-		GPU_ms_exit();
-
 	BKE_reset_undo(); 
 	
 	ED_file_exit(); /* for fsmenu */




More information about the Bf-blender-cvs mailing list