[Bf-blender-cvs] [6161b8dc63a] blender-v3.3-release: Fix T100130: animation player crash on exit

Brecht Van Lommel noreply at git.blender.org
Thu Aug 11 19:27:23 CEST 2022


Commit: 6161b8dc63a47982da36738e43d05dfd08aa7d21
Author: Brecht Van Lommel
Date:   Thu Aug 11 19:03:20 2022 +0200
Branches: blender-v3.3-release
https://developer.blender.org/rB6161b8dc63a47982da36738e43d05dfd08aa7d21

Fix T100130: animation player crash on exit

GPU_exit is now expected to run within an active GPU context.

Also run BLF_exit and IMB_exit first they can use GPU resources and gave
ASAN errors. And remove redundant GPU_shader_free_builtin_shaders already
handled by GPU_exit.

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

M	source/blender/windowmanager/intern/wm_playanim.c

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

diff --git a/source/blender/windowmanager/intern/wm_playanim.c b/source/blender/windowmanager/intern/wm_playanim.c
index 99f117f267a..790019b68b8 100644
--- a/source/blender/windowmanager/intern/wm_playanim.c
+++ b/source/blender/windowmanager/intern/wm_playanim.c
@@ -1807,21 +1807,22 @@ static char *wm_main_playanim_intern(int argc, const char **argv)
   AUD_Sound_free(source);
   source = NULL;
 #endif
+
   /* we still miss freeing a lot!,
    * but many areas could skip initialization too for anim play */
 
-  GPU_shader_free_builtin_shaders();
+  IMB_exit();
+  DEG_free_node_types();
+
+  BLF_exit();
 
   if (g_WS.gpu_context) {
     GPU_context_active_set(g_WS.gpu_context);
+    GPU_exit();
     GPU_context_discard(g_WS.gpu_context);
     g_WS.gpu_context = NULL;
   }
 
-  BLF_exit();
-
-  GPU_exit();
-
   GHOST_DisposeWindow(g_WS.ghost_system, g_WS.ghost_window);
 
   /* early exit, IMB and BKE should be exited only in end */
@@ -1830,9 +1831,6 @@ static char *wm_main_playanim_intern(int argc, const char **argv)
     return filepath;
   }
 
-  IMB_exit();
-  DEG_free_node_types();
-
   totblock = MEM_get_memory_blocks_in_use();
   if (totblock != 0) {
     /* prints many bAKey, bArgument's which are tricky to fix */



More information about the Bf-blender-cvs mailing list