From 9dab028fa877631d33c27cc4e38c86aa684a8055 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 5 Dec 2016 14:06:43 +0100 Subject: [PATCH] TextEditor: Initialize all members Creator can start to shutdown before initialize is called. This should be safe here right now, but let's not take chances in case somebody refactors this later. Change-Id: I961c215b8dffc92cf90d9f83e91b0b3034772077 Reviewed-by: David Schulz --- src/plugins/texteditor/texteditorplugin.cpp | 2 -- src/plugins/texteditor/texteditorplugin.h | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/plugins/texteditor/texteditorplugin.cpp b/src/plugins/texteditor/texteditorplugin.cpp index 8c729f9bdc0..f6406e1afc2 100644 --- a/src/plugins/texteditor/texteditorplugin.cpp +++ b/src/plugins/texteditor/texteditorplugin.cpp @@ -71,8 +71,6 @@ static const char kCurrentDocumentFontSize[] = "CurrentDocument:FontSize"; static TextEditorPlugin *m_instance = 0; TextEditorPlugin::TextEditorPlugin() - : m_settings(0), - m_lineNumberFilter(0) { QTC_ASSERT(!m_instance, return); m_instance = this; diff --git a/src/plugins/texteditor/texteditorplugin.h b/src/plugins/texteditor/texteditorplugin.h index 5cabb2fc95e..4dc3f3b724e 100644 --- a/src/plugins/texteditor/texteditorplugin.h +++ b/src/plugins/texteditor/texteditorplugin.h @@ -60,10 +60,10 @@ private: void updateSearchResultsTabWidth(const TextEditor::TabSettings &tabSettings); void updateCurrentSelection(const QString &text); - TextEditorSettings *m_settings; - LineNumberFilter *m_lineNumberFilter; - OutlineFactory *m_outlineFactory; - TextMarkRegistry *m_baseTextMarkRegistry; + TextEditorSettings *m_settings = nullptr; + LineNumberFilter *m_lineNumberFilter = nullptr; + OutlineFactory *m_outlineFactory = nullptr; + TextMarkRegistry *m_baseTextMarkRegistry = nullptr; #ifdef WITH_TESTS private slots: