From a6942b7923c7f996d93e8aa9836ce736ac80af3d Mon Sep 17 00:00:00 2001 From: Youness Alaoui Date: Mon, 25 Feb 2019 16:54:28 -0500 Subject: [PATCH] Fix crash when right-clicking twice on fullscreen panel If you right click once on the fullscreen panel and the context menu pop up then you right click again somewhere else on the panel *while the previous context menu is still visible* then it will cause a crash with : "Windows fatal exception: access violation" It seems to be caused by a crash in the QT event loop, trying to delete the existing QMenu within an event handler. --- manuskript/ui/editors/fullScreenEditor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/manuskript/ui/editors/fullScreenEditor.py b/manuskript/ui/editors/fullScreenEditor.py index bc71715..f65b7ed 100644 --- a/manuskript/ui/editors/fullScreenEditor.py +++ b/manuskript/ui/editors/fullScreenEditor.py @@ -359,6 +359,7 @@ class myPanel(QWidget): self.show() self.setAttribute(Qt.WA_TranslucentBackground) self._autoHide = True + self._m = None if not vertical: self.setLayout(QHBoxLayout()) @@ -379,6 +380,8 @@ class myPanel(QWidget): def mouseReleaseEvent(self, event): if event.button() == Qt.RightButton: + if self._m: + self._m.deleteLater() m = QMenu() a = QAction(self.tr("Auto-hide"), m) a.setCheckable(True)