add console for ctrl+c to daemon app when debugging in foreground

This commit is contained in:
walker0643 2018-03-29 12:02:35 -04:00
parent ecfa7d7d1c
commit fe818a4955
1 changed files with 4 additions and 2 deletions

View File

@ -130,8 +130,10 @@ DaemonApp::run(int argc, char** argv)
} }
if (foreground) { if (foreground) {
// run process in foreground instead of daemonizing. // add a console to catch Ctrl+C and run process in foreground
// useful for debugging. // instead of daemonizing. useful for debugging.
if (IsDebuggerPresent())
AllocConsole();
mainLoop(false); mainLoop(false);
} }
else { else {