SDL, Debugger: Fix some deinitialization issues
Jeffrey Pfau jeffrey@endrift.com
Sat, 04 Jun 2016 15:28:05 -0700
2 files changed,
7 insertions(+),
2 deletions(-)
M
src/debugger/cli-debugger.c
→
src/debugger/cli-debugger.c
@@ -741,7 +741,9 @@ history_end(cliDebugger->histate);
el_end(cliDebugger->elstate); if (cliDebugger->system) { - cliDebugger->system->deinit(cliDebugger->system); + if (cliDebugger->system->deinit) { + cliDebugger->system->deinit(cliDebugger->system); + } free(cliDebugger->system); cliDebugger->system = 0; }@@ -770,7 +772,9 @@ }
void CLIDebuggerAttachSystem(struct CLIDebugger* debugger, struct CLIDebuggerSystem* system) { if (debugger->system) { - debugger->system->deinit(debugger->system); + if (debugger->system->deinit) { + debugger->system->deinit(debugger->system); + } free(debugger->system); }
M
src/platform/sdl/main.c
→
src/platform/sdl/main.c
@@ -146,6 +146,7 @@
freeArguments(&args); mCoreConfigFreeOpts(&opts); mCoreConfigDeinit(&renderer.core->config); + renderer.core->deinit(renderer.core); return ret; }