-
-
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
Fix System.ObjectDisposedException for TransparentTextBox #2619
Conversation
On form close, all controls are set to invisible, but TransparentTextBoxes are already disposed. This commit blocks the method if the the tab control is already disposed.
Trying to figure out why your class is treated differently, [ComVisible(true)]
[ClassInterface (ClassInterfaceType.AutoDispatch)] Can you check whether adding those to If not, I kind of want to take it for a spin with a custom compiled Mono to investigate, but that would probably have to be after the 25th at this point. |
Looks bad for your holidays... |
Hmm, I'm getting this when I run this branch - I get the instance selector, then it throws the exception.
|
Huh, I have no idea how my changes could affect |
I'm guessing that's #2624. I can't even launch current HEAD on Mono. |
I would be happy if this is the case. I can't find any way in which my change leave something Null which is later somehow accessed (even over detours) by |
Wait, if this branch hasn't been rebased or merged, then that wouldn't make sense since #2617's change wouldn't be here. Never mind... |
That's not what I was hoping for... |
@politas On which OS do you get the error? I don't encounter it on Kubuntu nor Windows... |
@DasSkelett ignore my report. I'm getting the same error on master Head. |
That's an emotional rollercoaster with you guys... |
Good news, @DasSkelett, it's not your fault! Changing the controls back to ordinary
(etc., etc.) So this is probably caused purely by #2556. With that in mind, I think the current fix makes sense. |
Christmas is 5 days late, but I won't complain. |
With #2610 I created a new TransparentTextBox class derived from TextBox, which allows textboxes with transparent background.
For unknown reasons, they behave different to normal textboxes when you close the GUI.
The seem to get disposed too early, because
DataGridView
wants to clear the selection before getting disposed. This triggers multiple methods one after the other, includingMain.ModList_SelectedIndexChanged()
, which finally leads to hiding the mod info tab and its included controls.But all transparent textboxes are already disposed, so it throws the
error.
Workaround:
Now I break the chain in
Main.ModList_SelectedIndexChanged()
by testing if theModInfoTabControl
is already disposed, and if so, do nothing more, so don't try to hide every control in the end.HebaruSan currently tries to find the cause of the bug.
Fixes #2618 , more or less.