From 5eadb33222ea8b0ab94bc8499a9caf2b02f5eb7b Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Sun, 7 Dec 2014 13:53:13 +0200 Subject: [PATCH] Settings object is now allocated on stack, no need to delete it. --- projects/stargazer/main.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/projects/stargazer/main.cpp b/projects/stargazer/main.cpp index 3db3b266..73786c4e 100644 --- a/projects/stargazer/main.cpp +++ b/projects/stargazer/main.cpp @@ -66,7 +66,7 @@ namespace std::set executers; void StartTimer(); -int StartScriptExecuter(char * procName, int msgKey, int * msgID, SETTINGS_IMPL * settings); +int StartScriptExecuter(char * procName, int msgKey, int * msgID); int ForkAndWait(const std::string & confDir); void KillExecuters(); @@ -89,9 +89,9 @@ else } //----------------------------------------------------------------------------- #if defined(LINUX) || defined(DARWIN) -int StartScriptExecuter(char * procName, int msgKey, int * msgID, SETTINGS_IMPL * settings) +int StartScriptExecuter(char * procName, int msgKey, int * msgID) #else -int StartScriptExecuter(char *, int msgKey, int * msgID, SETTINGS_IMPL * settings) +int StartScriptExecuter(char *, int msgKey, int * msgID) #endif { STG_LOGGER & WriteServLog = GetStgLogger(); @@ -132,7 +132,6 @@ switch (pid) return -1; case 0: - delete settings; #if defined(LINUX) || defined(DARWIN) Executer(*msgID, pid, procName); #else @@ -251,7 +250,7 @@ WriteServLog("Stg v. %s", SERVER_VERSION); for (size_t i = 0; i < settings.GetExecutersNum(); i++) { - int ret = StartScriptExecuter(argv[0], settings.GetExecMsgKey(), &msgID, &settings); + int ret = StartScriptExecuter(argv[0], settings.GetExecMsgKey(), &msgID); if (ret < 0) { STG_LOGGER & WriteServLog = GetStgLogger(); -- 2.44.2