From 1a103f1eee373882a7ed5e2225fcd23bb10ecbc8 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Thu, 1 Jul 2010 14:30:54 +0200 Subject: [PATCH] Fix assertion when uniniting without any notifications The lazy initialization from commit 3dc04fa caused a small regression: When a process would init and uninit libnotify without ever sending a notification, _proxy was still NULL, which caused an assertion (process:20953): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed Bug-Ubuntu: https://bugs.launchpad.net/bugs/570462 --- libnotify/notify.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libnotify/notify.c b/libnotify/notify.c index a24a5fd..8491cf1 100644 --- a/libnotify/notify.c +++ b/libnotify/notify.c @@ -182,7 +182,9 @@ notify_uninit (void) } } - g_object_unref (_proxy); + if (_proxy != NULL) { + g_object_unref (_proxy); + } _initted = FALSE; }