File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,11 @@ public final class Image extends Resource implements Drawable {
9090 */
9191 public int type ;
9292
93+ /**
94+ * this field make sure the image is initialized without any errors
95+ */
96+ boolean isInitialized = false ;
97+
9398 /**
9499 * specifies the transparent pixel
95100 */
@@ -648,6 +653,12 @@ private ImageData adaptImageDataIfDisabledOrGray(ImageData data) {
648653 return returnImageData ;
649654}
650655
656+ @ Override
657+ void init () {
658+ super .init ();
659+ this .isInitialized = true ;
660+ }
661+
651662private ImageData applyDisableImageData (ImageData data , int height , int width ) {
652663 PaletteData palette = data .palette ;
653664 RGB [] rgbs = new RGB [3 ];
@@ -1905,7 +1916,7 @@ private abstract class AbstractImageProviderWrapper {
19051916 abstract AbstractImageProviderWrapper createCopy (Image image );
19061917
19071918 protected boolean isDisposed () {
1908- return isDestroyed ;
1919+ return isInitialized && isDestroyed ;
19091920 }
19101921
19111922 protected void destroy () {
You can’t perform that action at this time.
0 commit comments