Skip to content

Commit 2c5b605

Browse files
committed
Remove document listener from document on handleDispose()
UpdateDocumentListener is added to document but not always removed in ProjectionViewer, regression introduced by commit 1848058 This fixes only one possible leak, where a single document was used in ProjectionViewer, to unblock JDT UI tests. Fixes eclipse-jdt/eclipse.jdt.ui#2532
1 parent d77df82 commit 2c5b605

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

bundles/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionViewer.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1480,6 +1480,12 @@ private boolean willAutoExpand(Position position, int offset, int length) {
14801480
@Override
14811481
protected void handleDispose() {
14821482
fWasProjectionEnabled= false;
1483+
if (fUpdateDocumentListener != null) {
1484+
IDocument document= getDocument();
1485+
if (document != null) {
1486+
document.removeDocumentListener(fUpdateDocumentListener);
1487+
}
1488+
}
14831489
super.handleDispose();
14841490
}
14851491

0 commit comments

Comments
 (0)