Skip to content

Commit

Permalink
Fix NullReferenceException when unregistering folding manager after t…
Browse files Browse the repository at this point in the history
…he document was detached from the TextArea.
  • Loading branch information
dgrunwald committed Dec 19, 2019
1 parent b98689a commit b070099
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ICSharpCode.AvalonEdit/Rendering/CollapsedLineSection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,12 @@ public void Uncollapse()
if (start == null)
return;

heightTree.Uncollapse(this);
if (!heightTree.IsDisposed) {
heightTree.Uncollapse(this);
#if DEBUG
heightTree.CheckProperties();
heightTree.CheckProperties();
#endif
}

start = null;
end = null;
Expand Down
6 changes: 6 additions & 0 deletions ICSharpCode.AvalonEdit/Rendering/HeightTree.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ public void Dispose()
this.weakLineTracker = null;
}

public bool IsDisposed {
get {
return root == null;
}
}

double defaultLineHeight;

public double DefaultLineHeight {
Expand Down

0 comments on commit b070099

Please sign in to comment.