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.
This commit is contained in:
parent
35ec599730
commit
f3fffd5259
4 changed files with 17 additions and 4 deletions
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue