diff options
author | Steve Northover | 2005-09-26 18:02:24 +0000 |
---|---|---|
committer | Steve Northover | 2005-09-26 18:02:24 +0000 |
commit | 959d3049265ba82eabb24c0ce0a0cae5570aa6a4 (patch) | |
tree | b835fe6ef9aa3a344ccbe6808b3318116ca247ea /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt | |
parent | e2b41c856549753142bad97cd51db6142738c302 (diff) | |
download | eclipse.platform.swt-959d3049265ba82eabb24c0ce0a0cae5570aa6a4.tar.gz eclipse.platform.swt-959d3049265ba82eabb24c0ce0a0cae5570aa6a4.tar.xz eclipse.platform.swt-959d3049265ba82eabb24c0ce0a0cae5570aa6a4.zip |
get rid of multiple code paths that do g_free()
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java index 208c0111df..35bb121ca8 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java @@ -1572,9 +1572,7 @@ int getMessageCount () { /** * Returns the work area, an EWMH property to store the size * and position of the screen not covered by dock and panel - * windows. - * - * http://freedesktop.org/Standards/wm-spec + * windows. See http://freedesktop.org/Standards/wm-spec. */ Rectangle getWorkArea() { byte[] name = Converter.wcsToMbcs (null, "_NET_WORKAREA", true); @@ -1585,16 +1583,19 @@ Rectangle getWorkArea() { int[] actualLength = new int[1]; int /*long*/[] data = new int /*long*/[1]; int values [] = new int [4]; - if (!OS.gdk_property_get (OS.GDK_ROOT_PARENT (), atom, OS.GDK_NONE, 0, 16, 0, actualType, actualFormat, actualLength, data)) + if (!OS.gdk_property_get (OS.GDK_ROOT_PARENT (), atom, OS.GDK_NONE, 0, 16, 0, actualType, actualFormat, actualLength, data)) { return null; - if (data [0] == 0) return null; - if (actualLength [0] < 16) { + } + Rectangle result = null; + if (data [0] != 0) { + if (actualLength [0] >= 16) { + OS.memmove (values, data[0], 16); + OS.g_free (data[0]); + result = new Rectangle (values [0],values [1],values [2],values [3]); + } OS.g_free (data [0]); - return null; } - OS.memmove (values, data[0], 16); - OS.g_free (data[0]); - return new Rectangle (values [0],values [1],values [2],values [3]); + return result; } /** |