]> git.stg.codes - stg.git/blobdiff - projects/stargazer/main.cpp
Ticket 26. The SETTINGS_IMPL newSettings object declaration moved into
[stg.git] / projects / stargazer / main.cpp
index b8857633a18b9bc4c681fcd10968e6c083162a71..860800f80987e7b4e10c655496957edab11cfd56 100644 (file)
@@ -221,7 +221,6 @@ if (getuid())
     }
 
 SETTINGS_IMPL settings(argc == 2 ? argv[1] : "");
-SETTINGS_IMPL newSettings = settings;
 
 if (settings.ReadSettings())
     {
@@ -339,6 +338,8 @@ while (running)
     switch (sig)
         {
         case SIGHUP:
+            {
+            SETTINGS_IMPL newSettings(settings);
             if (newSettings.ReadSettings())
                 {
                 STG_LOGGER & WriteServLog = GetStgLogger();
@@ -349,8 +350,10 @@ while (running)
                 WriteServLog("ReadSettings error. %s", newSettings.GetStrError().c_str());
                 return -1;
                 }
+            settings = newSettings;
             traffCnt.Reload();
             manager.reload();
+            }
             break;
         case SIGTERM:
             running = false;