Don't call exit() directly. Instead, use the backend's quit() method for normal

shutdown, and error() for abnormal termination.

svn-id: r20818
This commit is contained in:
Torbjörn Andersson 2006-02-23 07:45:51 +00:00
parent ed577e61d5
commit 43f2d984fb
3 changed files with 6 additions and 9 deletions

View File

@ -48,7 +48,7 @@ void manageEvents(void) {
mouseData.Y = event.mouse.y;
break;
case OSystem::EVENT_QUIT:
exit(0);
g_system->quit();
break;
default:
break;

View File

@ -436,10 +436,9 @@ u8 compareObjectParam(u8 objIdx, u8 param1, s16 param2) {
}
default:
{
printf
("Unsupported compare type: %d in compareObjectParam\n",
error
("Unsupported compare type: %d in compareObjectParam",
param1 - 1);
exit(1);
}
}

View File

@ -403,10 +403,9 @@ u16 computeScriptStackSub(u8 mode, byte *scriptPtr, s16 *stackPtr,
}
default:
{
printf
("Unsupported opcode %X in computeScriptStack\n",
error
("Unsupported opcode %X in computeScriptStack",
opcode - 1);
exit(1);
}
}
@ -2752,8 +2751,7 @@ void executeScript(prcLinkedListStruct *scriptElement, u16 param) {
}
default:
{
printf("Unsupported opcode %X\n", opcode - 1);
exit(1);
error("Unsupported opcode %X", opcode - 1);
}
}
}