-
-
Notifications
You must be signed in to change notification settings - Fork 410
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
RuntimeError: wrapped C/C++ object of type QWidget has been deleted #4377
Comments
Did the error happens also in napari 0.4.15? |
Hi thank you for your reply, I just tested this and unfortunately this error still occurs in 0.4.15 |
In general there is a problem with removing and then creating a new viewer. The core of the problem are pending Qt events. Because you put only exception without stacktrace I'm not sure if I correctly understand the source of the problem. But if I good understand your problem I see three solutions:
If you need more details for any of my suggestions feel free to ask. I'm not sure which one is best/most intuitive for you. |
Sorry for not including it in the start, here is the full stack trace
I tried all of your suggestions:
Sorry for lots of questions, if making the widget as a class is the proper way to do it I will convert my code to that for robustness. |
In the napari test, we observe that But as you publish full stacktrace this may not work. I think that in your case problem is magicgui widget that was cleaned after the first close of the viewer. I'm not familiar with using magicgui this way. Maybe @tlambert03 have better knowledge in this area.
Based on |
I think a much more elegant fix is this one 5243 |
馃悰 Bug
Hello, thank you everyone napari is amazing. I have scoured the docs / previous issues but the most similar one seemed to be https://github.com/napari/magicgui/issues/28 which didnt fix my issue
I hope I am posting this in the right place. This seems to be an issue with qt deleting my previous widget in a for loop and me not being able to use add_dock_widget again
To Reproduce
This is my widget
This is how I launch it
Steps to reproduce the behavior:
it gives me this error:
RuntimeError: wrapped C/C++ object of type QWidget has been deleted
None
and forcing garbage collection , but this is an issue with QT C++ I assume so this didnt helpExpected behavior
I expect napari to close all my widgets and their references when the main viewer window is closed, this was supposed to be fixed by #2036
The Qt mainwindow only weakly references the widgets so previous widget instances should be deleted if I understand correctly
Environment
I am using napari 0.4.14
The text was updated successfully, but these errors were encountered: