From 5360f69e1e46812b317a21ef13a49004313b8ee8 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 520a34bb33..b3c7a4df17 100644 --- a/modules/ripple_basics/utility/ripple_Log.cpp +++ b/modules/ripple_basics/utility/ripple_Log.cpp @@ -286,10 +286,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)