diff --git a/src/winmain.c b/src/winmain.c index e1fdf0f9b..73e7bf7eb 100644 --- a/src/winmain.c +++ b/src/winmain.c @@ -97,6 +97,8 @@ extern bool ft_ngdebug; /* some additional debug info printed */ extern bool ft_batchmode; extern FILE *flogp; /* definition see xmain.c, stdout redirected to file */ +extern void cp_doquit(void); + #include "winmain.h" /* -------------------------------------------------------- */ @@ -506,11 +508,8 @@ MainWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) goto DEFAULT_AFTER; case WM_CLOSE: - /* Put Spice commmand "Quit" to end the program into the text buffer */ - PostSpiceCommand("quit"); - - /* If simulation is running, set a breakpoint */ - raise (SIGINT); + cp_doquit(); + /* continue if the user declined the 'quit' command */ return 0; case WM_SIZE: