From 694cc56ed30b837e4ae7b26d266d714832ba88c4 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 18 Dec 2019 13:49:10 +0100 Subject: [PATCH] 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 --- src/plugins/coreplugin/outputwindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/outputwindow.cpp b/src/plugins/coreplugin/outputwindow.cpp index fe054ea1aab..8a70d2a9947 100644 --- a/src/plugins/coreplugin/outputwindow.cpp +++ b/src/plugins/coreplugin/outputwindow.cpp @@ -33,6 +33,7 @@ #include #include +#include #include #include #include @@ -58,7 +59,7 @@ public: } IContext *outputWindowContext = nullptr; - Utils::OutputFormatter *formatter = nullptr; + QPointer formatter; QString settingsKey; bool enforceNewline = false;