From 85a9280846bf13ebdd86095e9c8b6b4fd53f723d Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Mon, 13 Jan 2025 15:58:22 +0100 Subject: [PATCH] Remove dispose call for Colors in StickyScrollingHandler According to the Javadoc on Colors: * Colors do not need to be disposed, however to maintain compatibility * with older code, disposing a Color is not an error. --- .../texteditor/stickyscroll/StickyScrollingHandler.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/bundles/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/stickyscroll/StickyScrollingHandler.java b/bundles/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/stickyscroll/StickyScrollingHandler.java index de457cf0ca0..316cca3a636 100644 --- a/bundles/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/stickyscroll/StickyScrollingHandler.java +++ b/bundles/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/stickyscroll/StickyScrollingHandler.java @@ -122,9 +122,7 @@ private StickyScrollingControlSettings loadControlSettings(IPreferenceStore stor int stickyScrollingMaxCount= store.getInt(EDITOR_STICKY_SCROLLING_MAXIMUM_COUNT); Color lineNumberColor= new Color(PreferenceConverter.getColor(store, EDITOR_LINE_NUMBER_RULER_COLOR)); - sourceViewer.getTextWidget().addDisposeListener(e -> lineNumberColor.dispose()); Color stickyLineHoverColor= new Color(PreferenceConverter.getColor(store, EDITOR_CURRENT_LINE_COLOR)); - sourceViewer.getTextWidget().addDisposeListener(e -> stickyLineHoverColor.dispose()); Color stickyLineBackgroundColor= sourceViewer.getTextWidget().getBackground(); boolean showLineNumbers= store.getBoolean(EDITOR_LINE_NUMBER_RULER); Color stickyLineSeparatorColor= null;