Skip to content

Commit 79e1308

Browse files
committed
[Win] Prevent processing incomplete Image object #1742
In specific situations, Images may be added to the Device's registered resources set when the Image is not fully initialized. This may lead to AIOBEs when the addition to the resources set calls equals on the not fully initialized image. This change removes the processing of an non-initialized image by ensuring that initialization is finished before the addition to the Device's resource set happens. Contributes to #1742
1 parent 290019e commit 79e1308

File tree

1 file changed

+1
-1
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics

1 file changed

+1
-1
lines changed

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ public final class Image extends Resource implements Drawable {
133133
private Image (Device device, int nativeZoom) {
134134
super(device);
135135
initialNativeZoom = nativeZoom;
136-
this.device.registerResourceWithZoomSupport(this);
137136
}
138137

139138
/**
@@ -2077,6 +2076,7 @@ public static Image win32_new(Device device, int type, long handle, int nativeZo
20772076
Image image = new Image(device, nativeZoom);
20782077
image.type = type;
20792078
image.new ImageHandle(handle, nativeZoom);
2079+
image.device.registerResourceWithZoomSupport(image);
20802080
return image;
20812081
}
20822082

0 commit comments

Comments
 (0)