Fix crash when monitor is disconnected during dock animation - #339
Open
purvansh2003-creator wants to merge 1 commit into
Open
Fix crash when monitor is disconnected during dock animation#339purvansh2003-creator wants to merge 1 commit into
purvansh2003-creator wants to merge 1 commit into
Conversation
this.dash is nulled by destroyDash() when a monitor is removed, but an in-flight animate() call (recursive via the fast-forward loop, or re-entered mid-tick from the animation timer) can still be executing and throws: TypeError: can't access property 'opacity', this.dash is null This disables the extension until it is manually re-enabled or the shell is restarted. Add a guard at the top of animate() and inside the fast-forward loop so it exits cleanly instead of crashing once this.dash has been torn down.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Bug: Disconnecting an external monitor while the dock is animating (autohide/fast-forward) crashes with:
TypeError: can't access property "opacity", this.dash is null
at animate (dock.js)
This disables the extension until it's manually re-enabled or the shell is restarted.
Cause:
destroyDocks()callsundock()→cancelAnimations()→destroyDash()in order, but a synchronous animation tick already in progress (recursive_fast_forwardloop, or one re-entered mid-call from therunLooptimer) can still referencethis.dashafter it's been nulled out — a re-entrancy race that ordering alone can't prevent.Fix: Guard
animate()to return early ifthis.dashis null, and break out of the fast-forward loop if it becomes null mid-iteration.Repro: Two monitors, autohide enabled, unplug the external display — reliable and immediate crash, confirmed via
journalctl --user -b0 -f.