Fix GUI freeze with non-empty changeset at startup #3708
Merged
+14
−19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
After KSP-CKAN/NetKAN#9438 and KSP-CKAN/CKAN-meta#3125, ZeroMiniAVC becomes auto-uninstallable (see #2753) for most users who have it. Unfortunately the client has problems with this.
The change set tab appears and the Apply changes button becomes enabled while the GUI is still responsive, but clicking Apply changes or the change set tab froze the GUI. Multiple users have reported this on the forum and Discord.
Steps to reproduce:
Cause
GUI properties on
Changeset
are being manipulated from a background thread, rather than WinForms's designated "GUI thread" (🤮). This destabilizes that tab, so when we try to make it visible (by clicking the Changeset tab or the Apply changes button) or further manipulate it (by checking or unchecking the Install or auto-installed checkboxes for some mods), something in the runtime seizes up and stops responding during the call toTabControl.SelectTab
, which never returns.Without an auto-uninstallable mod, the change set is empty, so the tab isn't updated.
Changes
Now
ManageMods.ChangeSetUpdated
is wrapped in aUtil.Invoke
call, since this is the outermost part of the relevant call stack that sets GUI properties (which were harmless at this level but still technically not allowed). This will allow the change set tab to be updated without being corrupted.Fixes #3707.