[at-spi2-core] Warn if a device listener returns a non-bool, rather than crash
- From: Mike Gorse <mgorse src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [at-spi2-core] Warn if a device listener returns a non-bool, rather than crash
- Date: Thu, 5 Jan 2012 21:00:15 +0000 (UTC)
commit b7bbc86a845270ffa1597ff8b5c9231eebddd512
Author: Mike Gorse <mgorse novell com>
Date: Thu Dec 29 08:23:10 2011 -0600
Warn if a device listener returns a non-bool, rather than crash
atspi/atspi-device-listener.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/atspi/atspi-device-listener.c b/atspi/atspi-device-listener.c
index 1e68eb1..58a6d6a 100644
--- a/atspi/atspi-device-listener.c
+++ b/atspi/atspi-device-listener.c
@@ -389,6 +389,11 @@ _atspi_dbus_handle_DeviceEvent (DBusConnection *bus, DBusMessage *message, void
if (klass->device_event)
{
retval = (*klass->device_event) (listener, &event);
+ if (retval != 0 && retval != 1)
+ {
+ g_warning ("at-spi: device event handler returned %d; should be 0 or 1", retval);
+ retval = 0;
+ }
}
done:
reply = dbus_message_new_method_return (message);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]