dont crash plasmoid from too fast mouse events

make sure that we delete a valid contextMenu and
not a ghost reference. This could occur from
two-fingers emulating right-click in wayland.

BUG: 397635
FIXED-IN: 0.8.1
(cherry picked from commit afb34a85cf)
v0.8
Michail Vourlakos 7 years ago
parent 60f488f3a1
commit 56b4be6f8e

@ -66,6 +66,7 @@ PlasmaComponents.ContextMenu {
activitiesDesktopsMenu.refresh();
} else if (status == PlasmaComponents.DialogStatus.Closed) {
root.startCheckRestoreZoomTimer(100);
root.contextMenu = null;
menu.destroy();
backend.ungrabMouse(visualParent);
}
@ -83,8 +84,9 @@ PlasmaComponents.ContextMenu {
loadDynamicLaunchActions(visualParent.m.LauncherUrlWithoutIcon);
// backend.ungrabMouse(visualParent);
openRelative();
windowsPreviewDlg.contextMenu = true;
windowsPreviewDlg.hide();
windowsPreviewDlg.hide("8.2");
icList.directRender = false;

@ -1145,7 +1145,11 @@ MouseArea{
contextMenu = root.createContextMenu(mainItemContainer, modelIndex(), args);
contextMenu.show();
} else {
root.contextMenu.close();
//! make sure that context menu isnt deleted multiple times and creates a crash
//! bug case: 397635
var cMenu = root.contextMenu;
root.contextMenu = null;
cMenu.destroy();
}
}

Loading…
Cancel
Save