Commit a9ea36dc authored by Patrick Ohly's avatar Patrick Ohly
Browse files

logging: be more careful about destructing the loggers

Destructing the config in TSyncAppBase::~TSyncAppBase triggered
calls into the logger. Now keep the logger around (even though
it no longer has a valid config), destruct the config, then
destruct the logger.

Also set the pointers to NULL. Not sure whether this is checked
at all places, though. I've seen code which just uses the
result of getDbgLogger() without checking for NULL.
parent d4558fa6
......@@ -1268,14 +1268,20 @@ TSyncAppBase::~TSyncAppBase()
if (fAppLoggerP) {
// - but first make sure applogger does not refer to it any more
fAppLogger.setOptions(NULL);
}
#endif
// - now delete
if (fConfigP) delete fConfigP;
#ifdef SYDEBUG
if (fAppLoggerP) {
// - remove references to local logger and delete it
if (fGlobalAppLoggerP == fAppLoggerP)
fGlobalAppLoggerP = NULL;
delete fAppLoggerP;
fAppLoggerP = NULL;
}
#endif
// - now delete
if (fConfigP) delete fConfigP;
} // TSyncAppBase::~TSyncAppBase
#ifdef SYDEBUG
......
......@@ -1072,6 +1072,7 @@ TSyncSession::~TSyncSession()
#ifdef SYDEBUG
fSessionLogger.DebugThreadOutputDone();
delete fSessionLoggerP;
fSessionLoggerP = NULL;
#endif
} // TSyncSession::~TSyncSession
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment