-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
Correct disposal implementation for exception widget #22782
Conversation
@michelkaporin, |
@michelkaporin the issue here is that you are using a scheduler with a 50ms which can happen after the widget is disposed. |
…tion widget disposal instead.
Pushed the proper change, thanks for the advice @isidorn! |
@michelkaporin I think you misunderstood me, you do not need to care about disposing |
@isidorn In fact it is already added in the constructor. My second commit is anyway redundant then. In addition, when the dispose method is called on the scheduler, it cancels it before disposing. I've looked at the code flow again and it seems that the problem lies not in the fact that _viewZone was disposed and scheduler not, as I thought initially. It seems to be that the scheduler was created and called before the _viewZone was instantiated with zoneWidget.show() method. I will revert the last commit back to be3d0cf which looks like a correct fix for me in this scenario, do you agree? |
@michelkaporin sometimes it is easier to communicate in code, here's what I meant 1bd0389 The difference that you already have a listener to schedule the scheduler to be disposed, but not the scheduler itself. The difference is the following An event happens and you schedule |
@isidorn Makes sense now. Sorry, I was wrongly assuming that I am disposing the scheduler, whereas it was a listener. Thanks for explanation. |
@michelkaporin no worries, welcome. |
I believe the reason for the the exception is that _viewZone was disposed meanwhile it was scheduled to relayout. Added null check for _viewZone. Correct me if I am wrong.
Fixes #22607