Skip to content

Commit 71be7d1

Browse files
committed
Bug 575983 - Stop disposing colors in swt
Handle snippets. Change-Id: Ia201057d454be4cd6a1bc0280ac2da22a34b193b Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/185562 Tested-by: Platform Bot <[email protected]> Reviewed-by: Alexander Kurtakov <[email protected]>
1 parent 5ab108d commit 71be7d1

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet141.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ public void run() {
9393
}
9494
offScreenImageGC.setBackground(bgColor != null ? bgColor : shellBackground);
9595
offScreenImageGC.fillRectangle(imageData.x, imageData.y, imageData.width, imageData.height);
96-
if (bgColor != null) bgColor.dispose();
9796
break;
9897
case SWT.DM_FILL_PREVIOUS:
9998
/* Restore the previous image before drawing. */

examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet194.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2015 IBM Corporation and others.
2+
* Copyright (c) 2000, 2021 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -66,10 +66,6 @@ public void run() {
6666
} catch (SWTException ex) {
6767
System.out.println("Error saving GIF: " + ex);
6868
} finally {
69-
white.dispose();
70-
red.dispose();
71-
green.dispose();
72-
blue.dispose();
7369
font.dispose();
7470
display.dispose();
7571
}

0 commit comments

Comments
 (0)