diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-06-26 20:03:44 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-06-26 20:03:44 +0000 |
commit | 3587d7e69cd25f14eccec01c547f1257171fde7b (patch) | |
tree | 7424ad05e24c4b9e1c1db087773d74c4ff59cc43 | |
parent | d796321b6b552284080af5560030e9c8d0f06321 (diff) | |
download | qemu-3587d7e69cd25f14eccec01c547f1257171fde7b.zip qemu-3587d7e69cd25f14eccec01c547f1257171fde7b.tar.gz qemu-3587d7e69cd25f14eccec01c547f1257171fde7b.tar.bz2 |
fix crash when closing windows (Frediano Ziglio)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2026 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r-- | vl.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -5495,6 +5495,14 @@ static void select_soundhw (const char *optarg) } #endif +#ifdef _WIN32 +static BOOL WINAPI qemu_ctrl_handler(DWORD type) +{ + exit(STATUS_CONTROL_C_EXIT); + return TRUE; +} +#endif + #define MAX_NET_CLIENTS 32 int main(int argc, char **argv) @@ -5534,6 +5542,8 @@ int main(int argc, char **argv) act.sa_handler = SIG_IGN; sigaction(SIGPIPE, &act, NULL); } +#else + SetConsoleCtrlHandler(qemu_ctrl_handler, TRUE); #endif init_timers(); |