mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-12 12:54:29 +00:00
Fixes leak of DolphinFileMetaDataWidget in ToolTipManager
Summary: Fixes leak of DolphinFileMetaDataWidget in ToolTipManager. The destructor of ToolTipManager failed to delete the m_fileMetaDataWidget member. This is seen at shutdown but also when you close a tab that has displayed a tooltip. Test Plan: Compile Dolphin with address sanitizer Open Dolphin Show a tooltip Close Dolphin Reviewers: #dolphin, elvisangelaccio Reviewed By: #dolphin, elvisangelaccio Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D19485
This commit is contained in:
parent
9f2bb143b5
commit
94d7e1471e
|
@ -82,11 +82,10 @@ void ToolTipManager::showToolTip(const KFileItem& item, const QRectF& itemRect,
|
|||
// Only start the retrieving of the content, when the mouse has been over this
|
||||
// item for 200 milliseconds. This prevents a lot of useless preview jobs and
|
||||
// meta data retrieval, when passing rapidly over a lot of items.
|
||||
delete m_fileMetaDataWidget;
|
||||
m_fileMetaDataWidget = new DolphinFileMetaDataWidget();
|
||||
connect(m_fileMetaDataWidget, &DolphinFileMetaDataWidget::metaDataRequestFinished,
|
||||
m_fileMetaDataWidget.reset(new DolphinFileMetaDataWidget());
|
||||
connect(m_fileMetaDataWidget.data(), &DolphinFileMetaDataWidget::metaDataRequestFinished,
|
||||
this, &ToolTipManager::slotMetaDataRequestFinished);
|
||||
connect(m_fileMetaDataWidget, &DolphinFileMetaDataWidget::urlActivated,
|
||||
connect(m_fileMetaDataWidget.data(), &DolphinFileMetaDataWidget::urlActivated,
|
||||
this, &ToolTipManager::urlActivated);
|
||||
|
||||
m_contentRetrievalTimer->start();
|
||||
|
@ -209,7 +208,7 @@ void ToolTipManager::showToolTip()
|
|||
if (!m_tooltipWidget) {
|
||||
m_tooltipWidget.reset(new KToolTipWidget());
|
||||
}
|
||||
m_tooltipWidget->showBelow(m_itemRect, m_fileMetaDataWidget, m_transientParent);
|
||||
m_tooltipWidget->showBelow(m_itemRect, m_fileMetaDataWidget.data(), m_transientParent);
|
||||
m_toolTipRequested = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ private:
|
|||
/// Transient parent of the tooltip, mandatory on Wayland.
|
||||
QWindow* m_transientParent;
|
||||
|
||||
DolphinFileMetaDataWidget* m_fileMetaDataWidget;
|
||||
QScopedPointer<DolphinFileMetaDataWidget> m_fileMetaDataWidget;
|
||||
QScopedPointer<KToolTipWidget> m_tooltipWidget;
|
||||
|
||||
bool m_toolTipRequested;
|
||||
|
|
Loading…
Reference in a new issue