Fix rare ToolTipManager crash on exit

If tooltips are enabled and you hover over item
while immediately closing Dolphin sometimes it would crash
because native parent might have been destroyed before
DolphinView
This commit is contained in:
Dāvis Mosāns 2022-06-12 02:55:12 +01:00
parent 957e6309b8
commit fc2d181291

View file

@ -1225,7 +1225,10 @@ void DolphinView::slotItemHovered(int index)
itemRect.moveTo(pos);
#ifdef HAVE_BALOO
m_toolTipManager->showToolTip(item, itemRect, nativeParentWidget()->windowHandle());
auto nativeParent = nativeParentWidget();
if (nativeParent) {
m_toolTipManager->showToolTip(item, itemRect, nativeParent->windowHandle());
}
#endif
}