diff options
author | Bill Haneman <billh@src.gnome.org> | 2001-11-29 15:51:40 +0000 |
---|---|---|
committer | Bill Haneman <billh@src.gnome.org> | 2001-11-29 15:51:40 +0000 |
commit | 46a2e3a6b369b300d67c81cc1200ffbbb6b9c87b (patch) | |
tree | fb8f7591e6d75d66f70d3e3c0044d6eebb5c8d71 | |
parent | 044fc69874579678cd2af937cf63b9a7a8bf94c2 (diff) | |
download | atk-46a2e3a6b369b300d67c81cc1200ffbbb6b9c87b.tar.gz |
Fixed bug in atkutil when no impl library (e.g. libgail) is loaded.
Fixed small doc bug in atkobject.
-rw-r--r-- | ChangeLog | 11 | ||||
-rwxr-xr-x | atk/atkobject.c | 2 | ||||
-rwxr-xr-x | atk/atkutil.c | 24 |
3 files changed, 28 insertions, 9 deletions
@@ -1,3 +1,14 @@ +2001-11-28 Bill Haneman <bill.haneman@sun.com> + + * atk/atkutil.c: + Changed calls to g_type_class_peek() to g_type_class_ref() where + it makes more sense, and in other places check for a non-null + klass return before trying to call class methods. This prevents + SEGV if no Atk-implementation library has been loaded. + + * atk/atkobject.c: + Fixed gtk-doc warning. + 2001-11-28 Padraig O'Briain <padraig.obriain@sun.com> * atk/atkobject.[c|h]: diff --git a/atk/atkobject.c b/atk/atkobject.c index f3b3674..c7d7521 100755 --- a/atk/atkobject.c +++ b/atk/atkobject.c @@ -1142,7 +1142,7 @@ atk_object_notify (GObject *obj, /** * atk_role_get_name: - * @type: The #AtkRole whose name is required + * @role: The #AtkRole whose name is required * * Gets the description string describing the #Roleype @role. * diff --git a/atk/atkutil.c b/atk/atkutil.c index dd3e066..8212391 100755 --- a/atk/atkutil.c +++ b/atk/atkutil.c @@ -228,7 +228,7 @@ atk_remove_global_event_listener (guint listener_id) { AtkUtilClass *klass = g_type_class_peek (ATK_TYPE_UTIL); - if (klass->remove_global_event_listener) + if (klass && klass->remove_global_event_listener) klass->remove_global_event_listener (listener_id); } @@ -249,7 +249,7 @@ atk_add_key_event_listener (AtkKeySnoopFunc listener, gpointer data) { guint retval; AtkUtilClass *klass = g_type_class_peek (ATK_TYPE_UTIL); - if (klass->add_key_event_listener) + if (klass && klass->add_key_event_listener) { retval = klass->add_key_event_listener (listener, data); } @@ -307,15 +307,19 @@ atk_get_root (void) G_CONST_RETURN gchar* atk_get_toolkit_name (void) { - AtkUtilClass *klass = g_type_class_peek (ATK_TYPE_UTIL); + const gchar *retval; + AtkUtilClass *klass = g_type_class_ref (ATK_TYPE_UTIL); if (klass->get_toolkit_name) { - return klass->get_toolkit_name (); + retval = klass->get_toolkit_name (); } else { - return NULL; + retval = NULL; } + g_type_class_unref (klass); + + return retval; } /** @@ -328,13 +332,17 @@ atk_get_toolkit_name (void) G_CONST_RETURN gchar* atk_get_toolkit_version (void) { - AtkUtilClass *klass = g_type_class_peek (ATK_TYPE_UTIL); + const gchar *retval; + AtkUtilClass *klass = g_type_class_ref (ATK_TYPE_UTIL); if (klass->get_toolkit_version) { - return klass->get_toolkit_version (); + retval = klass->get_toolkit_version (); } else { - return NULL; + retval = NULL; } + g_type_class_unref (klass); + + return retval; } |