Details
-
Bug
-
Resolution: Incomplete
-
P2: Important
-
1.2.x
-
Linux 3, KDE 4
Description
We get a segfault in certain cases when right-clicking in a QDialog if we call
close() inside the mousePressEvent() handler. The case that I have observed is
when there is only one reference to the QDialog, and when one removes this
reference in response to the closeEvent() handler being called.
The interesting thing is that this only happens when right-clicking, not when
left-clicking or when clicking with the wheel or other mouse buttons. Perhaps
something to do with the fact that right-clicking is normally used to show a
context menu?
See example.py to reproduce the segfault.
Workaround:
To work around the segfault, one can remove the reference to the QDialog at a
later point. For example, by connecting to the 'destroyed' signal (and marking
the QDialog WA_DeleteOnClose), and then removing the reference, as opposed to
removing the reference in the closeEvent() handler.