Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-32

segfault when removing object reference (by assigning None)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P2: Important
    • 6.0
    • 1.2.x
    • PySide
    • 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.

      Attachments

        1. example.py
          1 kB
        2. example-fixed.py
          1 kB
        3. pyside-32-example.py
          1 kB
        4. pyside-32-example2.py
          2 kB
        5. pyside-32-example2-fixed.py
          2 kB
        6. pyside-32-example-fixed.py
          1 kB

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            bughunter2 Jelle Geerts
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: