summaryrefslogtreecommitdiff
path: root/src/plugins/help/helpwidget.cpp
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2018-01-17 16:15:12 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2018-01-17 16:24:43 +0000
commitb23dab3ba29586a321b99d18ec3eec46a64eddc7 (patch)
tree747ffb43c001952770d70c36bc98b7366fbda2f0 /src/plugins/help/helpwidget.cpp
parent47ad489b97200c66819687bee08aef47877aaa16 (diff)
downloadqt-creator-b23dab3ba29586a321b99d18ec3eec46a64eddc7.tar.gz
Avoid double deletion of HelpWidget when quitting application via Dock
HelpWidgets that are created to be shown in an external window, had two different places where they were deleted: 1) When the widget was closed (due to Qt::WA_DeleteOnClose) 2) In HelpPlugin::aboutToShutdown via manual delete call In certain circumstances (when the WebEngine backend was used) this caused a double delete. Specifically, after opening an external help window, and closing the MainWindow, the application did not quit due to QTBUG-62596. Now if the help window were left open, and the application was quit via the macOS Dock, this caused a crash. When the application quits, it calls the HelpPlugin::aboutToShutdown, which deletes the HelpWidget. This in turn destroys the WebEngine view, which destroys the underlying QQuickWidget, which destroys a QQuickRenderControl, which calls QQuickRenderControlPrivate::windowDestroyed, which handles all posted QEvent::DeferredDelete events, which in turn triggers the deletion of the same HelpWidget due to the Qt::WA_DeleteOnClose attribute. The solution is to remove the Qt::WA_DeleteOnClose attribute, and only delete the external HelpWidget on shutdown, and not on CloseEvent. Task-number: QTBUG-63945 Task-number: QTCREATORBUG-19582 Change-Id: I5b73ff7fe52e7e1259a8aa98c97c9dbedd5e3c20 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/help/helpwidget.cpp')
-rw-r--r--src/plugins/help/helpwidget.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/plugins/help/helpwidget.cpp b/src/plugins/help/helpwidget.cpp
index feb6c3ffa4..79336520f0 100644
--- a/src/plugins/help/helpwidget.cpp
+++ b/src/plugins/help/helpwidget.cpp
@@ -127,7 +127,6 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget
static int windowId = 0;
Core::ICore::registerWindow(this,
Core::Context(Core::Id("Help.Window.").withSuffix(++windowId)));
- setAttribute(Qt::WA_DeleteOnClose);
setAttribute(Qt::WA_QuitOnClose, false); // don't prevent Qt Creator from closing
}
if (style != SideBarWidget) {