all repos — mgba @ 1a42ed2b372c2f7a8a7e84778f67099f40881784

mGBA Game Boy Advance Emulator

SDL, Debugger: Fix some deinitialization issues
Jeffrey Pfau jeffrey@endrift.com
Sat, 04 Jun 2016 15:28:05 -0700
commit

1a42ed2b372c2f7a8a7e84778f67099f40881784

parent

6e5a79564f9fefe7da0b3a31f5dff55c2e53ffde

2 files changed, 7 insertions(+), 2 deletions(-)

jump to
M src/debugger/cli-debugger.csrc/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.csrc/platform/sdl/main.c

@@ -146,6 +146,7 @@

freeArguments(&args); mCoreConfigFreeOpts(&opts); mCoreConfigDeinit(&renderer.core->config); + renderer.core->deinit(renderer.core); return ret; }