[Xfce4-commits] <xfce4-notifyd:master> Don't try to free the placement data if it wasn't initialized.
Jérôme Guelfucci
noreply at xfce.org
Fri Dec 17 21:04:01 CET 2010
Updating branch refs/heads/master
to aac0a7b316d57a7d033f50ebfb5fc3560fed1656 (commit)
from 8709bcbddbb85ea7b76b93dd5dffc078b2fcf8e2 (commit)
commit aac0a7b316d57a7d033f50ebfb5fc3560fed1656
Author: Jérôme Guelfucci <jeromeg at xfce.org>
Date: Fri Dec 17 21:01:33 2010 +0100
Don't try to free the placement data if it wasn't initialized.
xfce4-notifyd/xfce-notify-daemon.c | 36 ++++++++++++++++++++----------------
1 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/xfce4-notifyd/xfce-notify-daemon.c b/xfce4-notifyd/xfce-notify-daemon.c
index 112450f..f677923 100644
--- a/xfce4-notifyd/xfce-notify-daemon.c
+++ b/xfce4-notifyd/xfce-notify-daemon.c
@@ -332,28 +332,32 @@ xfce_notify_daemon_init(XfceNotifyDaemon *xndaemon)
static void
xfce_notify_daemon_finalize(GObject *obj)
{
- gint nscreen = gdk_display_get_n_screens(gdk_display_get_default());
- gint i, j;
XfceNotifyDaemon *xndaemon = XFCE_NOTIFY_DAEMON(obj);
- for(i = 0; i < nscreen; ++i) {
- GdkScreen *screen = gdk_display_get_screen(gdk_display_get_default(), i);
- GdkWindow *groot = gdk_screen_get_root_window(screen);
- gint nmonitor = gdk_screen_get_n_monitors(screen);
+ if(xndaemon->reserved_rectangles && xndaemon->monitors_workarea) {
+ gint nscreen, i, j;
- gdk_window_remove_filter(groot, xfce_notify_rootwin_watch_workarea, xndaemon);
+ nscreen = gdk_display_get_n_screens(gdk_display_get_default());
- for(j = 0; j < nmonitor; j++) {
- if (xndaemon->reserved_rectangles[i][j])
- g_list_free(xndaemon->reserved_rectangles[i][j]);
- }
+ for(i = 0; i < nscreen; ++i) {
+ GdkScreen *screen = gdk_display_get_screen(gdk_display_get_default(), i);
+ GdkWindow *groot = gdk_screen_get_root_window(screen);
+ gint nmonitor = gdk_screen_get_n_monitors(screen);
- g_free(xndaemon->reserved_rectangles[i]);
- g_free(xndaemon->monitors_workarea[i]);
- }
+ gdk_window_remove_filter(groot, xfce_notify_rootwin_watch_workarea, xndaemon);
+
+ for(j = 0; j < nmonitor; j++) {
+ if (xndaemon->reserved_rectangles[i][j])
+ g_list_free(xndaemon->reserved_rectangles[i][j]);
+ }
- g_free(xndaemon->reserved_rectangles);
- g_free(xndaemon->monitors_workarea);
+ g_free(xndaemon->reserved_rectangles[i]);
+ g_free(xndaemon->monitors_workarea[i]);
+ }
+
+ g_free(xndaemon->reserved_rectangles);
+ g_free(xndaemon->monitors_workarea);
+ }
g_tree_destroy(xndaemon->active_notifications);
More information about the Xfce4-commits
mailing list