Dispose SourceViewerDecorationSupport in QuickSearchDialog - #4220
Conversation
The QuickSearchDialog did not dispose the SourceViewerDecorationSupport created in createViewerDecorations(), leading to a resource leak. This disposes SourceViewerDecorationSupport when closing the dialog.
|
This pull request changes some projects for the first time in this development cycle. An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch. Git patchFurther information are available in Common Build Issues - Missing version increments. |
There was a problem hiding this comment.
Pull request overview
Fixes a resource leak in the QuickSearch UI by ensuring SourceViewerDecorationSupport is properly tracked and disposed when the dialog is closed.
Changes:
- Store
SourceViewerDecorationSupportas a dialog field instead of a local variable. - Dispose the
SourceViewerDecorationSupportinstance duringQuickSearchDialog#close(). - Bump
org.eclipse.text.quicksearchbundle version.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| bundles/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/QuickSearchDialog.java | Track and dispose SourceViewerDecorationSupport to address a leak on dialog close. |
| bundles/org.eclipse.text.quicksearch/META-INF/MANIFEST.MF | Increment bundle version to reflect the bug fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (sourceViewerDecorationSupport != null) { | ||
| sourceViewerDecorationSupport.dispose(); | ||
| sourceViewerDecorationSupport = null; | ||
| } |
There was a problem hiding this comment.
Indeed this is the fishy part. What else in close should actually be moved to dispose such that it's always done and always only once?
merks
left a comment
There was a problem hiding this comment.
I take my approval back because while it looks correct, it only looks correct because other things are disposed in close, but I don't think that was correct before this change...
The
QuickSearchDialogdid not dispose theSourceViewerDecorationSupportcreated increateViewerDecorations(), leading to a resource leak. This disposesSourceViewerDecorationSupportwhen closing the dialog.