From 6161b8dc63a47982da36738e43d05dfd08aa7d21 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 11 Aug 2022 19:03:20 +0200 Subject: 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. --- source/blender/windowmanager/intern/wm_playanim.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) 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 */ -- cgit v1.2.3