Skip to content

Commit 02cd7f2

Browse files
akurtakoveselmeister
authored andcommitted
Fix SWT Resources disposal runtime warnings in installer
Method createBodyContent calls clearDisposable which empties the disposables collections without actually disposing them leading to dangling references. Make the method actually dispose all disposables before clearing ensures that all resources are actually freed.
1 parent 4a51d7e commit 02cd7f2

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

openchrom/plugins/net.openchrom.installer.ui/src/net/openchrom/installer/ui/wizards/PluginDiscoveryWizardMainPage.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,17 +286,16 @@ public void pluginDescriptorKindVisibilityUpdated() {
286286
public void dispose() {
287287

288288
super.dispose();
289-
for(Resource resource : disposables) {
290-
resource.dispose();
291-
}
292289
clearDisposables();
293290
if(discovery != null) {
294291
discovery.dispose();
295292
}
296293
}
297294

298295
private void clearDisposables() {
299-
296+
for(Resource resource : disposables) {
297+
resource.dispose();
298+
}
300299
disposables.clear();
301300
h1Font = null;
302301
h2Font = null;

0 commit comments

Comments
 (0)