Check for null condition variable in case reload thread hasn't started.
authorScott Cantor <cantor.2@osu.edu>
Wed, 1 Sep 2010 16:12:52 +0000 (16:12 +0000)
committerScott Cantor <cantor.2@osu.edu>
Wed, 1 Sep 2010 16:12:52 +0000 (16:12 +0000)
xmltooling/util/ReloadableXMLFile.cpp

index 4499c43..6c2b68a 100644 (file)
@@ -363,8 +363,13 @@ Lockable* ReloadableXMLFile::lock()
 
         // Update the timestamp regardless.
         m_filestamp = stat_buf.st_mtime;
-        m_log.info("change detected, signaling reload thread...");
-        m_reload_wait->signal();
+        if (m_reload_wait) {
+            m_log.info("change detected, signaling reload thread...");
+            m_reload_wait->signal();
+        }
+        else {
+            m_log.warn("change detected, but reload thread not started");
+        }
     }
 
     return this;