From f0a65179d8da50934ef2ef078c0e6bd221c4eed2 Mon Sep 17 00:00:00 2001 From: David Hallas Date: Wed, 13 Mar 2019 20:27:40 +0100 Subject: [PATCH] Fix crash at shutdown after showing a tooltip Summary: Fix crash at shutdown after showing a tooltip. The commit 94d7e1471e0a81b72285795ad91c4f6196157ae4 introduced a crash that occurs when closing Dolphin after Dolphin has showed a tooltip. This happens because the ToolTipManager::showToolTip function calls the KToopTipWidget::showBelow function passing in the pointer to the DolphinFileMetaDataWidget. But this also passes the ownership of the pointer to the KToopTipWidget as long as a new tooltip is not shown. The problem is that at shutdown, the KToopTipWidget instance will be destoyed first and therefore also destroy the DolphinFileMetaDataWidget instance (which the ToolTipManager still owns through the QScopedPointer) causing it to be deleted twice. The fix for this is simply to swap the order of these two members so that the DolphinFileMetaDataWidget is destroyed first by the QScopedPointer thereby removing it from the KToopTipWidget if it has been set as it's parent. Test Plan: Open Dolphin Show a Tool Tip Close Dolphin Reviewers: #dolphin, elvisangelaccio Reviewed By: #dolphin, elvisangelaccio Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D19737 --- src/views/tooltips/tooltipmanager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/tooltips/tooltipmanager.h b/src/views/tooltips/tooltipmanager.h index 63c723f802..10f88ad76e 100644 --- a/src/views/tooltips/tooltipmanager.h +++ b/src/views/tooltips/tooltipmanager.h @@ -84,8 +84,8 @@ private: /// Transient parent of the tooltip, mandatory on Wayland. QWindow* m_transientParent; - QScopedPointer m_fileMetaDataWidget; QScopedPointer m_tooltipWidget; + QScopedPointer m_fileMetaDataWidget; bool m_toolTipRequested; bool m_metaDataRequested;