[at-spi2-core] Don't g_object_unref a NULL object for event variant



commit 959ad9c7e3fbba7aee2dcd93043eea6b5105f95f
Author: Mike Gorse <mgorse novell com>
Date:   Sun Feb 19 16:23:42 2012 -0600

    Don't g_object_unref a NULL object for event variant
    
    If we get an event with what appears to be an accessible as the variant
    but we do not succeed in marshalling the accessible (possibly because it
    is the null path), do not unref the null object. Stops a glib warning.

 atspi/atspi-event-listener.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/atspi/atspi-event-listener.c b/atspi/atspi-event-listener.c
index b397d6f..4581f82 100644
--- a/atspi/atspi-event-listener.c
+++ b/atspi/atspi-event-listener.c
@@ -907,7 +907,8 @@ _atspi_dbus_handle_event (DBusConnection *bus, DBusMessage *message, void *data)
 	accessible = _atspi_dbus_return_accessible_from_iter (&iter_variant);
 	g_value_init (&e.any_data, ATSPI_TYPE_ACCESSIBLE);
 	g_value_set_instance (&e.any_data, accessible);
-	g_object_unref (accessible);	/* value now owns it */
+	if (accessible)
+	  g_object_unref (accessible);	/* value now owns it */
       }
       break;
     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]