1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

No need to dispose colors anymore.

Change-Id: I39e760a0dba9d220268ee738c8a085d14f0e188b
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
This commit is contained in:
Alexander Kurtakov 2020-11-18 10:00:04 +02:00
parent e632011f2c
commit 3abe3d28e6
3 changed files with 7 additions and 26 deletions

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.make.ui; singleton:=true
Bundle-Version: 8.0.0.qualifier
Bundle-Version: 8.0.100.qualifier
Bundle-Activator: org.eclipse.cdt.make.internal.ui.MakeUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2002, 2011 QNX Software Systems and others.
* Copyright (c) 2002, 2020 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@ -16,8 +16,6 @@ package org.eclipse.cdt.make.internal.ui.preferences;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Color;
@ -68,17 +66,10 @@ public class ColorEditor {
}
});
fButton.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent event) {
if (fImage != null) {
fImage.dispose();
fImage = null;
}
if (fColor != null) {
fColor.dispose();
fColor = null;
}
fButton.addDisposeListener(event -> {
if (fImage != null) {
fImage.dispose();
fImage = null;
}
});
}
@ -104,9 +95,6 @@ public class ColorEditor {
gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
gc.drawRectangle(0, 2, fExtent.x - 1, fExtent.y - 4);
if (fColor != null)
fColor.dispose();
fColor = new Color(display, fColorValue);
gc.setBackground(fColor);
gc.fillRectangle(1, 3, fExtent.x - 2, fExtent.y - 5);

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2013 QNX Software Systems and others.
* Copyright (c) 2000, 2020 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@ -53,13 +53,6 @@ public class ColorManager implements ISharedTextColors {
protected Map<RGB, Color> fColorTable = new HashMap<>(10);
@Override
public void dispose() {
for (Color color : fColorTable.values()) {
color.dispose();
}
}
@Override
public Color getColor(RGB rgb) {
Color color = fColorTable.get(rgb);