Skip to content

Blender 3.4/3.6 - QT Menus not being destroyed consistently and SEGFAULTing #19

@jonahjnewton

Description

@jonahjnewton

Describe the bug
QT windows opened through the Shotgun menu do not always get destroyed properly when they are closed, and thus cause Segmentation Faults often. I believe this is either due to the QT event loop not being handled properly, or the threads created by tk-framework-shotgunutils not being resolved before the window is destroyed with destroyLater in tk-core.

This happens very consistently when trying to create a New File through tk-multi-workfiles2, and also occurs when opening and closing the tk-multi-workfiles2 or tk-multi-about windows 2-3 times.

To Reproduce
Steps to reproduce the behavior:

  1. Load Blender 3.4+ with tk-blender
  2. Open tk-multi-workfiles2 File Open menu.
  3. Close tk-multi-workfiles2 File Open menu. Repeat 2-3 times.
  4. Blender will crash with a Seg Fault.

Desktop (please complete the following information):

  • OS: CentOS 7
  • Qt/Pyside2 5.15.12
  • Blender 3.4/3.6 (occurs in both)
  • Python 3.10
  • tk-framework-shotgunutils 5.9.1
  • tk-framework-qtwidgets 2.11.0
  • tk-multi-workfiles2 0.14.1
  • tk-multi-about 0.5.0
  • tk-core 0.20.26

Additional context
To prevent the QtWindowEventLoop operator from returning FINISHED immediately after opening Blender, I commented out the following lines in Shotgun_menu.py, causing the TIMER event to run continuously.

if self._app and not self.anyQtWindowsAreOpen():
        self.cancel(context)
        return {"FINISHED"}

The error occurs regardless of whether these lines are commented out or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions