MCPcopy Create free account
hub / github.com/clementgallet/libTAS / slotStop

Method slotStop

src/program/ui/MainWindow.cpp:1206–1232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1204}
1205
1206void MainWindow::slotStop()
1207{
1208 if (context->status == Context::QUITTING) {
1209 if (context->game_pid != 0) {
1210 /* Terminate the game process */
1211 kill(context->game_pid, SIGKILL);
1212 } else {
1213 /* In this case, the game has closed (because game_pid has been set
1214 * to 0 by loopExit) yet status is still QUITTING, because status
1215 * depends on whether fork_pid is alive, not the game itself.
1216 *
1217 * So in this case, the game process and the forked process have
1218 * different pids (which can happen with gdb, for example) and the
1219 * game process has quit, but the forked process has not.
1220 */
1221 gameLoop->killForkProcess();
1222 }
1223 return;
1224 }
1225
1226 if (context->status == Context::ACTIVE) {
1227 context->status = Context::QUITTING;
1228 updateStatus(Context::QUITTING);
1229 slotUpdateSettingsWindow(Context::QUITTING);
1230 game_thread.detach();
1231 }
1232}
1233
1234void MainWindow::slotBrowseGamePath()
1235{

Callers

nothing calls this directly

Calls 1

killForkProcessMethod · 0.80

Tested by

no test coverage detected