[GTK3] Workaround for a deadlock when killing the program while the debugger is stopped
This commit is contained in:
parent
cc0827c429
commit
a56a97d657
@ -507,3 +507,10 @@ void break_debugger(ConsoleWindow *self) {
|
||||
gtk_window_present_with_time(GTK_WINDOW(self), time(NULL));
|
||||
gtk_widget_grab_focus(GTK_WIDGET(self->input));
|
||||
}
|
||||
|
||||
// Hack to avoid deadlocking on queue reads ...
|
||||
void abort_debugger(ConsoleWindow *self) {
|
||||
g_async_queue_push(self->input_queue, g_strdup("c\0"));
|
||||
g_async_queue_push(self->output_queue, g_strdup("c\0"));
|
||||
console_clear(self);
|
||||
}
|
||||
|
@ -13,4 +13,5 @@ char *console_get_sync_input(ConsoleWindow *self, GB_gameboy_t *gb);
|
||||
void console_log(ConsoleWindow *self, const char *message, GB_log_attributes attributes);
|
||||
void console_clear(ConsoleWindow *self);
|
||||
void break_debugger(ConsoleWindow *self);
|
||||
void abort_debugger(ConsoleWindow *self);
|
||||
#endif
|
@ -435,12 +435,13 @@ static void stop(void) {
|
||||
GB_audio_set_paused(true);
|
||||
GB_debugger_set_disabled(&gb, true);
|
||||
|
||||
if (GB_debugger_is_stopped(&gb)) {
|
||||
// [self interruptDebugInputRead];
|
||||
}
|
||||
|
||||
gui_data.stopping = true;
|
||||
gui_data.running = false;
|
||||
|
||||
if (GB_debugger_is_stopped(&gb)) {
|
||||
abort_debugger(gui_data.console);
|
||||
}
|
||||
|
||||
while (gui_data.stopping);
|
||||
|
||||
GB_debugger_set_disabled(&gb, false);
|
||||
|
Loading…
Reference in New Issue
Block a user