Browse Source

[1704] Initialize sync_ in the initialization list

Mukund Sivaraman 13 years ago
parent
commit
bd5494fa3a
1 changed files with 4 additions and 3 deletions
  1. 4 3
      src/lib/log/logger_impl.cc

+ 4 - 3
src/lib/log/logger_impl.cc

@@ -49,10 +49,11 @@ namespace log {
 // one compiler requires that all member variables be constructed before the
 // one compiler requires that all member variables be constructed before the
 // constructor is run, but log4cplus::Logger (the type of logger_) has no
 // constructor is run, but log4cplus::Logger (the type of logger_) has no
 // default constructor.
 // default constructor.
-LoggerImpl::LoggerImpl(const string& name) : name_(expandLoggerName(name)),
-    logger_(log4cplus::Logger::getInstance(name_))
+LoggerImpl::LoggerImpl(const string& name) :
+    name_(expandLoggerName(name)),
+    logger_(log4cplus::Logger::getInstance(name_)),
+    sync_(new InterprocessSyncFile("logger"))
 {
 {
-    sync_ = new InterprocessSyncFile("logger");
 }
 }
 
 
 // Destructor. (Here because of virtual declaration.)
 // Destructor. (Here because of virtual declaration.)