Fix memory leak with the animation player exited with an error

When dropping files onto the player window the animation the player
would restart, freeing everything except for the GHOST_System.
This caused a memory leak in the case of an error, returning without
freeing the system.

Resolve by freeing the system along with everything else.
This commit is contained in:
Campbell Barton
2025-06-13 11:26:26 +10:00
parent 7f86b957ae
commit 4f4ce05435

View File

@@ -2189,6 +2189,8 @@ static std::optional<int> wm_main_playanim_intern(int argc, const char **argv, P
GHOST_DisposeWindow(ps.ghost_data.system, ps.ghost_data.window);
GHOST_DisposeSystem(ps.ghost_data.system);
/* Early exit, IMB and BKE should be exited only in end. */
if (ps.argv_next) {
args_next->argc = ps.argc_next;
@@ -2197,8 +2199,6 @@ static std::optional<int> wm_main_playanim_intern(int argc, const char **argv, P
return std::nullopt;
}
GHOST_DisposeSystem(ps.ghost_data.system);
return EXIT_SUCCESS;
}