avoid fatal error if NS_DEBUG is used before the 'main' function is reached
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Sat, 04 Aug 2007 16:03:08 +0200
changeset 1146 394db4614892
parent 1145 7308b6cb153f
child 1147 54d2196bb52e
avoid fatal error if NS_DEBUG is used before the 'main' function is reached
src/core/debug.cc
--- a/src/core/debug.cc	Sat Aug 04 14:51:09 2007 +0200
+++ b/src/core/debug.cc	Sat Aug 04 16:03:08 2007 +0200
@@ -54,6 +54,7 @@
     {
       return;
     }
+  bool allFound = true;
   std::string env = envVar;
   std::string::size_type cur = 0;
   std::string::size_type next = 0;
@@ -89,7 +90,7 @@
         }
       if (!found)
         {
-          NS_FATAL_ERROR ("No debug component named=\"" << tmp << "\"");
+          allFound = false;
         }
       if (next == std::string::npos)
         {
@@ -101,6 +102,11 @@
           break;
         }
     }
+  if (allFound)
+    {
+      g_firstDebug = true;
+    }
+  
 #endif
 }
 
@@ -123,7 +129,6 @@
   if (g_firstDebug) 
     {
       DebugComponentEnableEnvVar ();
-      g_firstDebug = false;
     }
   return m_isEnabled;
 }