Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blender_window garbage collect bug #45

Closed
hannesdelbeke opened this issue Oct 7, 2022 · 0 comments · Fixed by #46
Closed

blender_window garbage collect bug #45

hannesdelbeke opened this issue Oct 7, 2022 · 0 comments · Fixed by #46
Labels
bug Something isn't working

Comments

@hannesdelbeke
Copy link
Collaborator

hannesdelbeke commented Oct 7, 2022

when trying to get the parent from the blender widget python returns an exception instead
please note first time you run this in blender it works, but second time you get error.

from PySide2.QtWidgets import QApplication
app = QApplication.instance()
a = app._blender_window.parent() 

# first time
# <PySide2.QtGui.QWindow(0x1e6a52d5120, name="QWindowContainerClassWindow") at 0x000001E6A66E7340>

# second
# Error: Python: Traceback (most recent call last):
#  File "\Text", line 3, in <module>
# RuntimeError: Internal C++ object (PySide2.QtGui.QWindow) already deleted.

same if you try access the children, or any other attr

Originally posted by @hannesdelbeke in #42 (comment)

@hannesdelbeke hannesdelbeke changed the title my current theory: blender is wrapped in a qwindow. and pyside tries to delete the qwindow on closing blender in runCleanupFunctions , but it can't cause it's not python but c. blender_window garbage collect bug Oct 7, 2022
@hannesdelbeke hannesdelbeke linked a pull request Oct 7, 2022 that will close this issue
@hannesdelbeke hannesdelbeke added the bug Something isn't working label Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant