]> cloud.milkyroute.net Git - dolphin.git/commit
Fix crash at shutdown after showing a tooltip
authorDavid Hallas <david@davidhallas.dk>
Wed, 13 Mar 2019 19:27:40 +0000 (20:27 +0100)
committerDavid Hallas <david@davidhallas.dk>
Sun, 17 Mar 2019 17:09:02 +0000 (18:09 +0100)
commitf2b72c164888bce6dcdec343fd832a98f5837be1
treeea0a4819a5154cce6334b347ec3e11fb796cfc1c
parent21b140943d1f8e91a80e741d5f3983ef0052dd25
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