| 1204 | } |
| 1205 | |
| 1206 | void 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 | |
| 1234 | void MainWindow::slotBrowseGamePath() |
| 1235 | { |
nothing calls this directly
no test coverage detected