┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Hallas <[email protected]>2019-03-13 20:27:40 +0100
committerDavid Hallas <[email protected]>2019-03-17 18:10:11 +0100
commitf0a65179d8da50934ef2ef078c0e6bd221c4eed2 (patch)
treec84b65403d24220f83dde625b1d8ddf7873aade4
parentd6c086ad04adf306aea7cfc6961af805d8c4350e (diff)
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
-rw-r--r--src/views/tooltips/tooltipmanager.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/views/tooltips/tooltipmanager.h b/src/views/tooltips/tooltipmanager.h
index 63c723f80..10f88ad76 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<DolphinFileMetaDataWidget> m_fileMetaDataWidget;
QScopedPointer<KToolTipWidget> m_tooltipWidget;
+ QScopedPointer<DolphinFileMetaDataWidget> m_fileMetaDataWidget;
bool m_toolTipRequested;
bool m_metaDataRequested;