diff options
author | Felipe Heidrich <fheidric> | 2008-10-21 16:10:45 +0000 |
---|---|---|
committer | Felipe Heidrich <fheidric> | 2008-10-21 16:10:45 +0000 |
commit | 00a57778fa2193fc299fd680ffffa216d780d6cd (patch) | |
tree | c3508758e4179bb2e2478d3b3bf2e2a63901f6be /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse | |
parent | eade5c994cf5e49da8729b581d12f0f8e3143c71 (diff) | |
download | eclipse.platform.swt-00a57778fa2193fc299fd680ffffa216d780d6cd.tar.gz eclipse.platform.swt-00a57778fa2193fc299fd680ffffa216d780d6cd.tar.xz eclipse.platform.swt-00a57778fa2193fc299fd680ffffa216d780d6cd.zip |
251528 - Image created without tracking
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java index bd3a800cf0..1754574694 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java @@ -528,6 +528,12 @@ public Image(Device device, InputStream stream) { public Image(Device device, String filename) { super(device); if (filename == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); + initNative(filename); + if (this.pixmap == 0) init(new ImageData(filename)); + init(); +} + +void initNative(String filename) { try { int length = filename.length (); char [] chars = new char [length]; @@ -566,11 +572,8 @@ public Image(Device device, String filename) { this.pixmap = pixmap_return[0]; if (pixmap == 0) SWT.error(SWT.ERROR_NO_HANDLES); OS.g_object_unref (pixbuf); - return; } } catch (SWTException e) {} - init(new ImageData(filename)); - init(); } void createAlphaMask (int width, int height) { |