Browse Source

Ensure we call free_imports() when exiting.

Iain Patterson 5 years ago
parent
commit
b3b29f0b27
2 changed files with 1 additions and 2 deletions
  1. 1 1
      nssm.cpp
  2. 0 1
      service.cpp

+ 1 - 1
nssm.cpp

@@ -9,6 +9,7 @@ static TCHAR imagepath[PATH_LENGTH];
 static TCHAR imageargv0[PATH_LENGTH];
 
 void nssm_exit(int status) {
+  free_imports();
   unsetup_utf8();
   exit(status);
 }
@@ -300,7 +301,6 @@ int _tmain(int argc, TCHAR **argv) {
       /* User probably ran nssm with no argument */
       if (error == ERROR_FAILED_SERVICE_CONTROLLER_CONNECT) nssm_exit(usage(1));
       log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_DISPATCHER_FAILED, error_string(error), 0);
-      free_imports();
       nssm_exit(100);
     }
   }

+ 0 - 1
service.cpp

@@ -2110,7 +2110,6 @@ void CALLBACK end_service(void *arg, unsigned char why) {
       log_event(EVENTLOG_INFORMATION_TYPE, NSSM_EVENT_EXIT_UNCLEAN, service->name, code, exit_action_strings[action], 0);
       stop_service(service, exitcode, false, default_action);
       wait_for_hooks(service, false);
-      free_imports();
       nssm_exit(exitcode);
   }
 }