Core: Avoid accessing nullptr

The output window does not own the formatter
but in case of an erroenous ramp down of the
run control it may miss the destruction of the
run control.
This had led to strange nullptr accesses to the
formatter when clicking into the respective
application output pane afterwards.

Change-Id: I16fdf0e68f1f02537495436a82c9888c53c78345
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Stenger
2019-12-18 13:49:10 +01:00
parent d9a26acbb8
commit 694cc56ed3

View File

@@ -33,6 +33,7 @@
#include <utils/synchronousprocess.h> #include <utils/synchronousprocess.h>
#include <QAction> #include <QAction>
#include <QPointer>
#include <QRegularExpression> #include <QRegularExpression>
#include <QScrollBar> #include <QScrollBar>
#include <QTextBlock> #include <QTextBlock>
@@ -58,7 +59,7 @@ public:
} }
IContext *outputWindowContext = nullptr; IContext *outputWindowContext = nullptr;
Utils::OutputFormatter *formatter = nullptr; QPointer<Utils::OutputFormatter> formatter;
QString settingsKey; QString settingsKey;
bool enforceNewline = false; bool enforceNewline = false;