diff options
author | kristian <kristian@d7aaf104-2d23-0410-ae22-9d23157bf5a3> | 2006-12-11 11:02:56 +0000 |
---|---|---|
committer | kristian <kristian@d7aaf104-2d23-0410-ae22-9d23157bf5a3> | 2006-12-11 11:02:56 +0000 |
commit | 0aed2dff2ca28f9778666bfdccd250269ddf9563 (patch) | |
tree | c8e2224b9df3167b84de8181cb77ca97c8eb3242 | |
parent | f5d621cb58983b1539cb0b8b34f7c2a06cfed1dd (diff) | |
download | marex-dev-0aed2dff2ca28f9778666bfdccd250269ddf9563.tar.gz marex-dev-0aed2dff2ca28f9778666bfdccd250269ddf9563.tar.bz2 |
Another attempt at #161. Reset data to NULL in attempt to avoid
XFree() an older (previously XFree'd) value on error.
git-svn-id: file:///beryl/trunk@1659 d7aaf104-2d23-0410-ae22-9d23157bf5a3
-rw-r--r-- | emerald/src/main.c | 14 |
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; } } |