Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Northover2005-09-26 18:02:24 +0000
committerSteve Northover2005-09-26 18:02:24 +0000
commit959d3049265ba82eabb24c0ce0a0cae5570aa6a4 (patch)
treeb835fe6ef9aa3a344ccbe6808b3318116ca247ea /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
parente2b41c856549753142bad97cd51db6142738c302 (diff)
downloadeclipse.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/widgets/Display.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java21
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;
}
/**

Back to the top