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.
Fixes two crashes that regularly appeared when opening multitasking view.
the slot of a windowclone can be null as noted in documentation. Without checking it we could crash when opening two windows on the same workspace, move one to another workspace without ever opening multitaskingview. If you then open multitasking view it would crash since it runs a few handlers trying to select another window since in the view of the multitasking view one was "removed" and in the process it will try to access fields on the slot that is null because it's the first time we open so they haven't taken a slot yet.
current_window could be unrefed twice if it was set to null in open which could cause the actor to be destroyed since current_window held the only ref on it. This in turn would cause the destroyed handler to run which would try to select another window as current and if that fails set the current_window to null again unrefing it a second time even though it was already disposing.
These are two independent crashes and I made them two commits so I'd say this can be rebase merged.