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 <ideasman42@gmail.com>2011-09-20 16:22:19 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-09-20 16:22:19 +0400
commit1657cbe61a756222feac5107f87d0d699a92b4a6 (patch)
tree7ddb3412347ca471083b9a74fb3d33f0e31e99cd /source/blender/windowmanager
parent78d4260144dbf01166fac8bc9303e6d5aa022f71 (diff)
fix [#28672] Blender segfault after exiting a game that was opened with
autoplay on (Blender, not blenderplayer) blender now stops the sound system and free's its self on Pythons sys.exit().
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/WM_api.h1
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c28
2 files changed, 19 insertions, 10 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index 5bdf1ec2787..9e19a057175 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -72,6 +72,7 @@ void WM_setinitialstate_fullscreen(void);
void WM_setinitialstate_normal(void);
void WM_init (struct bContext *C, int argc, const char **argv);
+void WM_exit_ext (struct bContext *C, const short do_python);
void WM_exit (struct bContext *C);
void WM_main (struct bContext *C);
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index 365301538b0..837b7eb1f2f 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -342,7 +342,8 @@ extern void free_fmodifiers_copybuf(void);
extern void free_posebuf(void);
/* called in creator.c even... tsk, split this! */
-void WM_exit(bContext *C)
+/* note, doesnt run exit() call WM_exit() for that */
+void WM_exit_ext(bContext *C, const short do_python)
{
wmWindow *win;
@@ -408,14 +409,17 @@ void WM_exit(bContext *C)
#ifdef WITH_PYTHON
- /* XXX - old note */
- /* before free_blender so py's gc happens while library still exists */
- /* needed at least for a rare sigsegv that can happen in pydrivers */
-
- /* Update for blender 2.5, move after free_blender because blender now holds references to PyObject's
- * so decref'ing them after python ends causes bad problems every time
- * the pyDriver bug can be fixed if it happens again we can deal with it then */
- BPY_python_end();
+ /* option not to close python so we can use 'atexit' */
+ if(do_python) {
+ /* XXX - old note */
+ /* before free_blender so py's gc happens while library still exists */
+ /* needed at least for a rare sigsegv that can happen in pydrivers */
+
+ /* Update for blender 2.5, move after free_blender because blender now holds references to PyObject's
+ * so decref'ing them after python ends causes bad problems every time
+ * the pyDriver bug can be fixed if it happens again we can deal with it then */
+ BPY_python_end();
+ }
#endif
GPU_global_buffer_pool_free();
@@ -460,6 +464,10 @@ void WM_exit(bContext *C)
getchar();
}
#endif
- exit(G.afbreek==1);
}
+void WM_exit(bContext *C)
+{
+ WM_exit_ext(C, 1);
+ exit(G.afbreek==1);
+}