diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-07-10 00:33:20 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-07-10 00:57:19 +0300 |
commit | 8373544df30a0e24b080a03c4d4c0b5108c4932d (patch) | |
tree | 70a25bd48e8573710aa9a14ba02b925644f125c3 /source/blender/windowmanager/intern/wm_playanim.c | |
parent | 845899d373df4fa5e692c828d6af151309169c87 (diff) |
Fix T55776: crash with multiple windows and reload new.
There were a number of cases where immActivate() and immDeactivate() could
get out of sync, causing crashes due to using a freed mutex lock. Refactor
the code now to hopefully avoid this always.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_playanim.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_playanim.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_playanim.c b/source/blender/windowmanager/intern/wm_playanim.c index ef7992dcb8c..003932930ed 100644 --- a/source/blender/windowmanager/intern/wm_playanim.c +++ b/source/blender/windowmanager/intern/wm_playanim.c @@ -1283,6 +1283,7 @@ static char *wm_main_playanim_intern(int argc, const char **argv) /* initialize OpenGL immediate mode */ g_WS.gwn_context = GWN_context_create(); GPU_init(); + immActivate(); /* initialize the font */ BLF_init(); @@ -1551,8 +1552,6 @@ static char *wm_main_playanim_intern(int argc, const char **argv) GPU_shader_free_builtin_shaders(); - GPU_exit(); - if (g_WS.gwn_context) { GWN_context_active_set(g_WS.gwn_context); GWN_context_discard(g_WS.gwn_context); @@ -1561,6 +1560,9 @@ static char *wm_main_playanim_intern(int argc, const char **argv) BLF_exit(); + immDeactivate(); + GPU_exit(); + GHOST_DisposeWindow(g_WS.ghost_system, g_WS.ghost_window); /* early exit, IMB and BKE should be exited only in end */ |