[at-spi2-core] Fix crash with event listener deregistration
- From: Mike Gorse <mgorse src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [at-spi2-core] Fix crash with event listener deregistration
- Date: Wed, 29 Dec 2010 08:55:04 +0000 (UTC)
commit e76171adce37b073aeaf0f96379ff99c450c8a5d
Author: Mike Gorse <mgorse novell com>
Date: Wed Dec 29 03:57:29 2010 -0500
Fix crash with event listener deregistration
atspi/atspi-event-listener.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/atspi/atspi-event-listener.c b/atspi/atspi-event-listener.c
index 438cb78..aa78562 100644
--- a/atspi/atspi-event-listener.c
+++ b/atspi/atspi-event-listener.c
@@ -534,7 +534,8 @@ atspi_event_listener_register_from_callback (AtspiEventListenerCB callback,
return;
dbus_message_append_args (message, DBUS_TYPE_STRING, &event_type, DBUS_TYPE_INVALID);
reply = _atspi_dbus_send_with_reply_and_block (message);
- dbus_message_unref (reply);
+ if (reply)
+ dbus_message_unref (reply);
return TRUE;
}
@@ -627,9 +628,13 @@ atspi_event_listener_deregister_from_callback (AtspiEventListenerCB callback,
is_superset (name, e->name) &&
is_superset (detail, e->detail))
{
+ gboolean need_replace;
DBusError error;
DBusMessage *message, *reply;
+ need_replace = (l == event_listeners);
l = g_list_remove (l, e);
+ if (need_replace)
+ event_listeners = l;
dbus_error_init (&error);
dbus_bus_remove_match (_atspi_bus(), matchrule, &error);
dbus_error_init (&error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]