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

Don't throw when destroying block decorations inside marker change event #15865

Merged
merged 1 commit into from Oct 11, 2017

Conversation

Projects
None yet
1 participant
@as-cii
Member

as-cii commented Oct 11, 2017

Fixes #15756

Previously, when markers were destroyed inside of a marker.onDidChange handler that was registered before decorating the marker, we would attempt to remove block decorations from the LineTopIndex twice: once when destroying the marker, and once when receiving the marker change event.

This was a little counterintuitive at first, because we were already disposing the change event handler associated with the marker upon its destruction. However, we would still receive a marker change event because the marker was getting destroyed while notifying its change event subscribers.

With this pull-request we will gracefully handle that situation by remembering that the marker became invalid during its destruction, so that when the change event is finally triggered, it will simply be ignored because the marker validity will not change.

/cc: @nathansobo @Ben3eeE

@as-cii as-cii merged commit 5fd109f into master Oct 11, 2017

3 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@as-cii as-cii deleted the as-fix-marker-change-event-block-decorations branch Oct 11, 2017

as-cii added a commit that referenced this pull request Oct 11, 2017

Merge pull request #15865 from atom/as-fix-marker-change-event-block-…
…decorations

Don't throw when destroying block decorations inside marker change event

as-cii added a commit that referenced this pull request Oct 11, 2017

Merge pull request #15865 from atom/as-fix-marker-change-event-block-…
…decorations

Don't throw when destroying block decorations inside marker change event
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment