SDL, Debugger: Fix some deinitialization issues

This commit is contained in:
Jeffrey Pfau 2016-06-04 15:28:05 -07:00
parent 6e5a79564f
commit 1a42ed2b37
2 changed files with 7 additions and 2 deletions

View File

@ -741,7 +741,9 @@ static void _cliDebuggerDeinit(struct mDebugger* debugger) {
el_end(cliDebugger->elstate); el_end(cliDebugger->elstate);
if (cliDebugger->system) { if (cliDebugger->system) {
if (cliDebugger->system->deinit) {
cliDebugger->system->deinit(cliDebugger->system); cliDebugger->system->deinit(cliDebugger->system);
}
free(cliDebugger->system); free(cliDebugger->system);
cliDebugger->system = 0; cliDebugger->system = 0;
} }
@ -770,7 +772,9 @@ void CLIDebuggerCreate(struct CLIDebugger* debugger) {
void CLIDebuggerAttachSystem(struct CLIDebugger* debugger, struct CLIDebuggerSystem* system) { void CLIDebuggerAttachSystem(struct CLIDebugger* debugger, struct CLIDebuggerSystem* system) {
if (debugger->system) { if (debugger->system) {
if (debugger->system->deinit) {
debugger->system->deinit(debugger->system); debugger->system->deinit(debugger->system);
}
free(debugger->system); free(debugger->system);
} }

View File

@ -146,6 +146,7 @@ int main(int argc, char** argv) {
freeArguments(&args); freeArguments(&args);
mCoreConfigFreeOpts(&opts); mCoreConfigFreeOpts(&opts);
mCoreConfigDeinit(&renderer.core->config); mCoreConfigDeinit(&renderer.core->config);
renderer.core->deinit(renderer.core);
return ret; return ret;
} }