summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--emerald/src/main.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/emerald/src/main.c b/emerald/src/main.c
index 916ef49..0828d9a 100644
--- a/emerald/src/main.c
+++ b/emerald/src/main.c
@@ -3277,7 +3277,7 @@ update_window_decoration_actions (WnckWindow *win)
//xroot = RootWindowOfScreen (gdk_x11_screen_get_xscreen (screen));
d->actions = wnck_window_get_actions (win);
-
+ data=NULL;
left=1;
offset=0;
while(left)
@@ -3296,14 +3296,22 @@ update_window_decoration_actions (WnckWindow *win)
{
d->actions |= FAKE_WINDOW_ACTION_HELP;
}
+ data=NULL;
} else {
/* This is an attempt to solve #161
+ * This is take two. data is apparantly set to non-null at
+ * some point but still doesn't contain something valid and
+ * XFree()'able, that's why we attempt to reset data to
+ * NULL after successfull XFree(). If this doesn't work,
+ * we'll have to skip the XFree() entierly on error.
+ * Also moved the fprintf so we get the error message before
+ * we crash ;)
* FIXME: Remove or alter the error message when this fix is sufficiently verified.
*/
- if(data)
- XFree((void *) data);
fprintf(stderr,"XGetWindowProperty() returned non-success value (%d).\n",result);
fprintf(stderr,"Please report this to the development team.\n" /* ,result */);
+ if(data && n)
+ XFree((void *) data);
break;
}
}