From b3b29f0b27046a282e688c494def532252ad21c3 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Fri, 5 Aug 2016 10:22:38 +0100 Subject: [PATCH] Ensure we call free_imports() when exiting. --- nssm.cpp | 2 +- service.cpp | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/nssm.cpp b/nssm.cpp index 9fde560..d70c6b4 100644 --- a/nssm.cpp +++ b/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); } } diff --git a/service.cpp b/service.cpp index 336cf27..d66b916 100644 --- a/service.cpp +++ b/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); } } -- 2.20.1