AttachConsole() isn't available in Windows 2000.
[nssm.git] / service.cpp
index f82b9bd..fcb1c5a 100644 (file)
@@ -538,7 +538,9 @@ void CALLBACK end_service(void *arg, unsigned char why) {
     /* Fake a crash so pre-Vista service managers will run recovery actions. */\r
     case NSSM_EXIT_UNCLEAN:\r
       log_event(EVENTLOG_INFORMATION_TYPE, NSSM_EVENT_EXIT_UNCLEAN, service_name, code, exit_action_strings[action], 0);\r
-      exit(stop_service(exitcode, false, default_action));\r
+      stop_service(exitcode, false, default_action);\r
+      free_imports();\r
+      exit(exitcode);\r
     break;\r
   }\r
 }\r