From d41a0cb563573bf6ce22efe04549eeb1795f0f61 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 17 Apr 2014 16:47:01 +0000 Subject: Fix BackgroundTask timer being destroyed after timer system cleaned up. Caused an assertion failure and crash. --- bin/bbackupd/BackupDaemon.cpp | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/bin/bbackupd/BackupDaemon.cpp b/bin/bbackupd/BackupDaemon.cpp index 3dbae4d6..7f883e21 100644 --- a/bin/bbackupd/BackupDaemon.cpp +++ b/bin/bbackupd/BackupDaemon.cpp @@ -477,25 +477,23 @@ void BackupDaemon::Run() } catch(...) { - if(mapCommandSocketInfo.get()) + try { - try - { - mapCommandSocketInfo.reset(); - } - catch(std::exception &e) - { - BOX_WARNING("Internal error while " - "closing command socket after " - "another exception: " << e.what()); - } - catch(...) - { - BOX_WARNING("Error closing command socket " - "after exception, ignored."); - } + mapCommandSocketInfo.reset(); + } + catch(std::exception &e) + { + BOX_WARNING("Internal error while closing command " + "socket after another exception, ignored: " << + e.what()); + } + catch(...) + { + BOX_WARNING("Error closing command socket after " + "exception, ignored."); } + mapCommandSocketPollTimer.reset(); Timers::Cleanup(); throw; @@ -503,6 +501,7 @@ void BackupDaemon::Run() // Clean up mapCommandSocketInfo.reset(); + mapCommandSocketPollTimer.reset(); Timers::Cleanup(); } -- cgit v1.2.3