Fix crash at shutdown after showing a tooltip

Authored by hallas on Mar 13 2019, 7:27 PM.

Description

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

Details

Committed
hallasMar 17 2019, 5:09 PM
Reviewer
Dolphin
Differential Revision
D19737: Fix crash at shutdown after showing a tooltip
Parents
R318:21b140943d1f: GIT_SILENT Upgrade KDE Applications version to 19.07.70.
Branches
Unknown
Tags
Unknown