-
-
Notifications
You must be signed in to change notification settings - Fork 345
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
"System.ObjectDisposedException: Cannot access a disposed object." error on closing form #2618
Comments
In order to have no mod selected and hide the mod info at startup, I added |
Is there a property in winforms that we could use to check whether something has been disposed or is being disposed? Seems like we should just skip EDIT: Or I guess we could just catch and ignore |
Yes, that
works, no error any more. Now there's only the not-working |
Is that |
No, not related to this problem, I just tumbled over it. |
Background
CKAN Version:
current master branch - 1.25.5
-> Bug introduced with #2610 (Yep, that's mine.)Bug introduced with #2556.
Operating System:
(K)ubuntu 18.04.1 - mono 5.16.0.220
Problem
What steps did you take in CKAN?
Closed the form in the mod list.
What happened?
Got an error message in the console:
It seems that
DataGridView.Dispose()
clears the selection withDataGridView.ClearSelection()
,which triggers
Main.ModList_SelectedIndexChanged()
,which sets
Main.ActiveModInfo
to null,that collapses
splitContainer1.Panel2
,which sets itself and all its controls to
Visible = false
, especially allTextBox
es.But those apparently are already disposed.
So (besides that I don't know why
DataGridView.Dispose()
wants to clear the selection, it's gone anyway, so why bother what's selected?...) somehowmy newall textboxes of the mod info tab dispose too early.Where I am atm
I found a workaround that I check inActiveModInfo
ifactuallyVisible == false
, but then you have an empty ModInfo tab after startup. That could be "fixed" if we have no row selected in our mod list at startup so the mod info is hidden.See #2619.
Thanks for your thoughts in advance.
The text was updated successfully, but these errors were encountered: