Explorar el Código

Windows: reactive sigint handler after each Ctrl-C (#736)

mgroeber9110 hace 2 años
padre
commit
53dbba7695
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      examples/main/main.cpp

+ 5 - 0
examples/main/main.cpp

@@ -368,6 +368,11 @@ int main(int argc, char ** argv) {
                 // potentially set color to indicate we are taking user input
                 // potentially set color to indicate we are taking user input
                 set_console_color(con_st, CONSOLE_COLOR_USER_INPUT);
                 set_console_color(con_st, CONSOLE_COLOR_USER_INPUT);
 
 
+#if defined (_WIN32)
+                // Windows: must reactivate sigint handler after each signal
+                signal(SIGINT, sigint_handler);
+#endif
+
                 if (params.instruct) {
                 if (params.instruct) {
                     printf("\n> ");
                     printf("\n> ");
                 }
                 }