Fixed server crash on startup
authorVictor Kirhenshtein <victor@netxms.org>
Fri, 6 Oct 2017 14:09:39 +0000 (17:09 +0300)
committerVictor Kirhenshtein <victor@netxms.org>
Fri, 6 Oct 2017 14:09:39 +0000 (17:09 +0300)
src/server/core/datacoll.cpp

index 97f542e..e3c11e7 100644 (file)
@@ -453,10 +453,10 @@ static THREAD_RESULT THREAD_CALL StatCollector(void *pArg)
    g_dAvgSyslogProcessingQueueSize = 0;
    g_dAvgSyslogWriterQueueSize = 0;
    g_dAvgPollerQueueSize = 0;
-   while(!IsShutdownInProgress())
+   while(!SleepAndCheckForShutdown(5))
    {
-      if (SleepAndCheckForShutdown(5))
-         break;      // Shutdown has arrived
+      if (!(g_flags & AF_SERVER_INITIALIZED))
+         continue;
 
       // Get current values
       ThreadPoolInfo poolInfo;