Close enhanced gui debugger in gui exit() method if necessary.

TODO: read / write enhanced gui debugger settings in init / close functions
This commit is contained in:
Volker Ruppert 2014-08-17 12:48:05 +00:00
parent 8e632c1bbe
commit 36aa1ae6d2
5 changed files with 29 additions and 4 deletions

View File

@ -3444,12 +3444,14 @@ void InitDebugDialog()
SIM->get_notify_callback(&old_callback, &old_callback_arg);
assert (old_callback != NULL);
SIM->set_notify_callback(enh_dbg_notify_callback, NULL);
// TODO: read enhanced debugger config here
DoAllInit(); // non-os-specific init stuff
OSInit();
}
void CloseDebugDialog()
{
// TODO: write enhanced debugger config here
SIM->set_notify_callback(old_callback, old_callback_arg);
CloseDialog();
}

View File

@ -1413,15 +1413,20 @@ void bx_sdl_gui_c::mouse_enabled_changed_specific (bx_bool val)
void bx_sdl_gui_c::exit(void)
{
if(sdl_screen)
if (sdl_screen)
SDL_FreeSurface(sdl_screen);
if(sdl_fullscreen)
if (sdl_fullscreen)
SDL_FreeSurface(sdl_fullscreen);
while(n_sdl_bitmaps)
{
while (n_sdl_bitmaps) {
SDL_FreeSurface(sdl_bitmaps[n_sdl_bitmaps-1]->surface);
n_sdl_bitmaps--;
}
#if BX_DEBUGGER && BX_DEBUGGER_GUI
if (SIM->has_debug_gui()) {
close_debug_dialog();
}
#endif
}
// New graphics API methods

View File

@ -1301,6 +1301,12 @@ void bx_sdl2_gui_c::exit(void)
SDL_FreeSurface(sdl_bitmaps[n_sdl_bitmaps-1]->surface);
n_sdl_bitmaps--;
}
#if BX_DEBUGGER && BX_DEBUGGER_GUI
if (SIM->has_debug_gui()) {
close_debug_dialog();
}
#endif
}
// New graphics API methods

View File

@ -2113,6 +2113,12 @@ void bx_win32_gui_c::replace_bitmap(unsigned hbar_id, unsigned bmap_id)
// exit from the native GUI mechanism.
void bx_win32_gui_c::exit(void)
{
#if BX_DEBUGGER && BX_DEBUGGER_GUI
if (SIM->has_debug_gui()) {
close_debug_dialog();
}
#endif
// kill thread first...
PostMessage(stInfo.mainWnd, WM_CLOSE, 0, 0);

View File

@ -1846,6 +1846,12 @@ void bx_x_gui_c::exit(void)
if (mouse_captured)
enable_cursor();
#if BX_DEBUGGER && BX_DEBUGGER_GUI
if (SIM->has_debug_gui()) {
close_debug_dialog();
}
#endif
if (bx_x_display)
XCloseDisplay(bx_x_display);