Skip to content

Commit

Permalink
Clear viewers set to TextEditorPropertyAction on dispose
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveeclipse committed Apr 9, 2024
1 parent bb54ca5 commit e94dcfc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ private void showWhitespace() {
for (int i = 0; i < viewers.length; i++) {
if (fNeedsPainters[i]) {
MergeSourceViewer viewer = viewers[i];
if (viewer == null) {
continue;
}
SourceViewer sourceViewer = viewer.getSourceViewer();
WhitespaceCharacterPainter painter;
if (fStore != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,14 @@ public void run() {
}

public void dispose() {
if (store != null)
if (viewers != null) {
for (int i = 0; i < viewers.length; i++) {
viewers[i] = null;
}
}
if (store != null) {
store.removePropertyChangeListener(this);
}
}

/**
Expand Down

0 comments on commit e94dcfc

Please sign in to comment.