+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]:
{
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);
}
{
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);
}
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;
}
/**
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;
}