QApplication is instanced, and a reference is saved in a variable in the QOperator.
the blender window is wrapped in QT, and is now managed by pyside/ the QApplication
when closing blender, operators likely get deregistered, which means the reference to QApplication is gone, and QApplication gets garbage collected.
but blender is managed by the QApp, which tries to delete all it's widgets etc.
since the operator owns qapp, qapp owns blender, and blender owns the operator. we have a loop.
moving the qapp to a global variable instead of the operator seems to fix the access violation error :D
notes
the specific commit that fixes the violation is the removal of the qoperator. replacing it with just a function
this PR addresses an issue with access violation
details:
QApplication is instanced, and a reference is saved in a variable in the QOperator. the blender window is wrapped in QT, and is now managed by pyside/ the QApplication
when closing blender, operators likely get deregistered, which means the reference to QApplication is gone, and QApplication gets garbage collected. but blender is managed by the QApp, which tries to delete all it's widgets etc.
since the operator owns qapp, qapp owns blender, and blender owns the operator. we have a loop.
moving the qapp to a global variable instead of the operator seems to fix the access violation error :D
notes the specific commit that fixes the violation is the removal of the qoperator. replacing it with just a function