Index: src/osd/windows/video.c =================================================================== --- src/osd/windows/video.c (revision 2295) +++ src/osd/windows/video.c (working copy) @@ -124,10 +124,6 @@ bitmap_free(effect_bitmap); effect_bitmap = NULL; - // possibly kill the debug window - if (options_get_bool(mame_options(), OPTION_DEBUG)) - debugwin_destroy_windows(); - // free all of our monitor information while (win_monitor_list != NULL) { Index: src/osd/windows/window.c =================================================================== --- src/osd/windows/window.c (revision 2295) +++ src/osd/windows/window.c (working copy) @@ -270,6 +270,10 @@ { assert(GetCurrentThreadId() == main_threadid); + // possibly kill the debug window + if (options_get_bool(mame_options(), OPTION_DEBUG)) + debugwin_destroy_windows(); + // free all the windows while (win_window_list != NULL) {