diff options
author | Christian Stenger <christian.stenger@qt.io> | 2019-12-18 13:49:10 +0100 |
---|---|---|
committer | Christian Stenger <christian.stenger@qt.io> | 2019-12-18 13:06:03 +0000 |
commit | 694cc56ed30b837e4ae7b26d266d714832ba88c4 (patch) | |
tree | 90c865689a3ebc5b3856fe360378254c53e862b3 | |
parent | d9a26acbb884944101b8d3b5b9edc9edf9a857b1 (diff) | |
download | qt-creator-694cc56ed30b837e4ae7b26d266d714832ba88c4.tar.gz |
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>
-rw-r--r-- | src/plugins/coreplugin/outputwindow.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/coreplugin/outputwindow.cpp b/src/plugins/coreplugin/outputwindow.cpp index fe054ea1aa..8a70d2a994 100644 --- a/src/plugins/coreplugin/outputwindow.cpp +++ b/src/plugins/coreplugin/outputwindow.cpp @@ -33,6 +33,7 @@ #include <utils/synchronousprocess.h> #include <QAction> +#include <QPointer> #include <QRegularExpression> #include <QScrollBar> #include <QTextBlock> @@ -58,7 +59,7 @@ public: } IContext *outputWindowContext = nullptr; - Utils::OutputFormatter *formatter = nullptr; + QPointer<Utils::OutputFormatter> formatter; QString settingsKey; bool enforceNewline = false; |