diff options
author | Andrew <forkk@forkk.net> | 2013-12-11 13:17:23 -0600 |
---|---|---|
committer | Andrew <forkk@forkk.net> | 2013-12-11 13:17:23 -0600 |
commit | f3fffd52594065995d4c355de1571b36b2f2bbeb (patch) | |
tree | cb9654d8ba5449d0e0ec1113a8ad1b739b73a1c4 /logger/QsLogDest.cpp | |
parent | 35ec5997308ec48f45c3a8d6483bc83dc1c1ef09 (diff) | |
download | MultiMC-f3fffd52594065995d4c355de1571b36b2f2bbeb.tar MultiMC-f3fffd52594065995d4c355de1571b36b2f2bbeb.tar.gz MultiMC-f3fffd52594065995d4c355de1571b36b2f2bbeb.tar.lz MultiMC-f3fffd52594065995d4c355de1571b36b2f2bbeb.tar.xz MultiMC-f3fffd52594065995d4c355de1571b36b2f2bbeb.zip |
Remove QsLog destinations when they are destroyed.
This fixes some issues where MultiMC was segfaulting on exit because
things were trying to write to the logger while they were being destroyed,
but the destinations had already been destroyed and were left in the list.
Diffstat (limited to 'logger/QsLogDest.cpp')
-rw-r--r-- | logger/QsLogDest.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/logger/QsLogDest.cpp b/logger/QsLogDest.cpp index 36297a14..2fd29b23 100644 --- a/logger/QsLogDest.cpp +++ b/logger/QsLogDest.cpp @@ -25,6 +25,7 @@ #include "QsLogDest.h" #include "QsDebugOutput.h" +#include "QsLog.h" #include <QFile> #include <QTextStream> #include <QString> @@ -32,6 +33,12 @@ namespace QsLogging { +Destination::~Destination() +{ + Logger::instance().removeDestination(this); + QsDebugOutput::output("Removed logger destination."); +} + //! file message sink class FileDestination : public Destination { |