diff options
author | Mike Gorse <mgorse@novell.com> | 2011-05-04 14:34:48 -0500 |
---|---|---|
committer | Mike Gorse <mgorse@novell.com> | 2011-05-04 14:41:32 -0500 |
commit | b592fea73b4e86463465fb934f45c126277fbdd6 (patch) | |
tree | 1de86cabb53f90c4ce75805054ae3eb224ee2464 | |
parent | f0b979c8d448ff45c93afb9670f7decf6a2e3a04 (diff) | |
download | at-spi2-core-b592fea73b4e86463465fb934f45c126277fbdd6.tar.gz |
Fix a possible crash when an application is short-lived
When GetAPplicationBusAddress is called, at-spi sets a callback to handle the
reply. It is possible that the application will go away and the
AtspiApplication will be disposed before this callback is reached, in which
case the reference to the accessibility bus connection will have gone away.
In this case, we should not call GetItems, since app->bus will be NULL and
libdbus will throw a SIGABRT.
-rw-r--r-- | atspi/atspi-misc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/atspi/atspi-misc.c b/atspi/atspi-misc.c index c4a90ab7..886f92ce 100644 --- a/atspi/atspi-misc.c +++ b/atspi/atspi-misc.c @@ -162,6 +162,9 @@ handle_get_bus_address (DBusPendingCall *pending, void *user_data) dbus_message_unref (reply); dbus_pending_call_unref (pending); + if (!app->bus) + return; /* application has gone away / been disposed */ + message = dbus_message_new_method_call (app->bus_name, "/org/a11y/atspi/cache", atspi_interface_cache, "GetItems"); |