fixes missing dispose of resources

This commit is contained in:
Eyck Jentzsch 2022-10-01 17:04:52 +02:00
parent 0105621be3
commit 1efb574a98
1 changed files with 3 additions and 3 deletions

View File

@ -74,6 +74,7 @@ import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn; import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem; import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Widget; import org.eclipse.swt.widgets.Widget;
import org.eclipse.wb.swt.SWTResourceManager;
import org.osgi.service.prefs.BackingStoreException; import org.osgi.service.prefs.BackingStoreException;
import com.minres.scviewer.database.DataType; import com.minres.scviewer.database.DataType;
@ -415,7 +416,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
if(res.get(0) instanceof ITx) { if(res.get(0) instanceof ITx) {
ITx tx = (ITx)res.get(0); ITx tx = (ITx)res.get(0);
final Display display = parent.getDisplay(); final Display display = parent.getDisplay();
final Font font = new Font(Display.getCurrent(), "Terminal", 10, SWT.NORMAL); final Font font = SWTResourceManager.getFont("Terminal", 10, SWT.NORMAL);
final Label label = new Label(parent, SWT.SHADOW_IN); final Label label = new Label(parent, SWT.SHADOW_IN);
label.setForeground(display.getSystemColor(SWT.COLOR_BLACK)); label.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
@ -471,8 +472,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
return true; return true;
} else if(res.get(0) instanceof TrackEntry) { } else if(res.get(0) instanceof TrackEntry) {
TrackEntry te = (TrackEntry)res.get(0); TrackEntry te = (TrackEntry)res.get(0);
final Font font = new Font(Display.getCurrent(), "Terminal", 10, SWT.NORMAL); final Font font = SWTResourceManager.getFont("Terminal", 10, SWT.NORMAL);
final Label label = new Label(parent, SWT.NONE); final Label label = new Label(parent, SWT.NONE);
label.setText(te.waveform.getFullName()); label.setText(te.waveform.getFullName());
label.setFont(font); label.setFont(font);