From 3523c52691f7d23bbcbb7d59d8d3d27359d9872c Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Wed, 19 Jun 2013 10:08:23 -0700 Subject: [PATCH] Don't crash on logrotate. --- modules/ripple_basics/utility/ripple_Log.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/ripple_basics/utility/ripple_Log.cpp b/modules/ripple_basics/utility/ripple_Log.cpp index 099edc78f9..c9a6701061 100644 --- a/modules/ripple_basics/utility/ripple_Log.cpp +++ b/modules/ripple_basics/utility/ripple_Log.cpp @@ -281,10 +281,13 @@ void Log::setLogFile (boost::filesystem::path const& path) outStream = newStream; - if (pathToLog != NULL) - delete pathToLog; + if (pathToLog != &path) + { + if (pathToLog != NULL) + delete pathToLog; - pathToLog = new boost::filesystem::path (path); + pathToLog = new boost::filesystem::path (path); + } } bool LogPartition::setSeverity (const std::string& partition, LogSeverity severity)