From: Maxim Mamontov Date: Sun, 7 Dec 2014 11:53:13 +0000 (+0200) Subject: Settings object is now allocated on stack, no need to delete it. X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/80b5356cc25c7c97dc44d22e2fb8946b7ac05595?ds=inline Settings object is now allocated on stack, no need to delete it. --- 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();