summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael@ximian.com>2001-12-10 10:32:45 +0000
committerMichael Meeks <michael@src.gnome.org>2001-12-10 10:32:45 +0000
commit3b4d67302b815d98710eb30228ddec8ab97f809b (patch)
treec68ade05211dac3c9b6b6637203319d70091cdab
parentb2c738351d09d2c50136a07f3d3a82a5b840b6c1 (diff)
downloadatk-3b4d67302b815d98710eb30228ddec8ab97f809b.tar.gz
paranoia is not appropriate here, setup parent_class, don't create a new
2001-12-08 Michael Meeks <michael@ximian.com> * atk/atkregistry.c (atk_registry_class_init): paranoia is not appropriate here, setup parent_class, don't create a new default registry here - makes no sense. (atk_registry_finalize): chain to parent class, do g_hash_table_destroys instead of g_frees.
-rw-r--r--ChangeLog9
-rw-r--r--atk/atknoopobject.c2
-rw-r--r--atk/atkregistry.c36
-rwxr-xr-xatk/atkutil.h1
4 files changed, 27 insertions, 21 deletions
diff --git a/ChangeLog b/ChangeLog
index a7db171..f15c5f4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2001-12-08 Michael Meeks <michael@ximian.com>
+
+ * atk/atkregistry.c (atk_registry_class_init):
+ paranoia is not appropriate here, setup parent_class,
+ don't create a new default registry here - makes no
+ sense.
+ (atk_registry_finalize): chain to parent class, do
+ g_hash_table_destroys instead of g_frees.
+
2001-12-07 Padraig O'Briain <padraig.obriain@sun.com>
* atk/Makefile.am:
diff --git a/atk/atknoopobject.c b/atk/atknoopobject.c
index 83bf1a7..f5576dd 100644
--- a/atk/atknoopobject.c
+++ b/atk/atknoopobject.c
@@ -143,7 +143,7 @@ atk_no_op_object_class_init (AtkNoOpObjectClass *klass)
AtkObject*
atk_no_op_object_new (GObject *obj)
{
- AtkObject* accessible;
+ AtkObject *accessible;
g_return_val_if_fail (obj != NULL, NULL);
diff --git a/atk/atkregistry.c b/atk/atkregistry.c
index fda1d5a..a6598de 100644
--- a/atk/atkregistry.c
+++ b/atk/atkregistry.c
@@ -26,8 +26,9 @@ static void atk_registry_init (AtkRegistry *instance
AtkRegistryClass *klass);
static void atk_registry_finalize (GObject *instance);
static void atk_registry_class_init (AtkRegistryClass *klass);
+static AtkRegistry* atk_registry_new (void);
-static AtkRegistry* atk_registry_new ();
+GObjectClass *parent_class;
GType
atk_registry_get_type (void)
@@ -59,14 +60,11 @@ atk_registry_get_type (void)
static void
atk_registry_class_init (AtkRegistryClass *klass)
{
- GObjectClass *object_class;
+ GObjectClass *object_class = (GObjectClass *) klass;
- /* is paranoia appropriate in a class initializer ? */
- g_return_if_fail (G_IS_OBJECT_CLASS (klass));
+ parent_class = g_type_class_peek_parent (klass);
- object_class = G_OBJECT_CLASS (klass);
object_class->finalize = atk_registry_finalize;
- default_registry = atk_registry_new ();
}
#if 0
@@ -79,7 +77,7 @@ atk_registry_class_finalize (GObjectClass *klass)
{
g_return_if_fail (ATK_IS_REGISTRY_CLASS (klass));
- g_free (default_registry);
+ g_object_unref (G_OBJECT (default_registry));
}
#endif
@@ -92,8 +90,8 @@ atk_registry_init (AtkRegistry *instance, AtkRegistryClass *klass)
(GEqualFunc) NULL);
}
-static AtkRegistry*
-atk_registry_new ()
+static AtkRegistry *
+atk_registry_new (void)
{
GObject *object;
@@ -105,14 +103,14 @@ atk_registry_new ()
}
static void
-atk_registry_finalize (GObject *instance)
+atk_registry_finalize (GObject *object)
{
- AtkRegistry *registry;
+ AtkRegistry *registry = ATK_REGISTRY (object);
- g_return_if_fail (ATK_IS_REGISTRY (instance));
- registry = ATK_REGISTRY (instance);
- g_free (registry->factory_type_registry);
- g_free (registry->factory_singleton_cache);
+ g_hash_table_destroy (registry->factory_type_registry);
+ g_hash_table_destroy (registry->factory_singleton_cache);
+
+ parent_class->finalize (object);
}
/**
@@ -263,11 +261,11 @@ atk_registry_get_factory (AtkRegistry *registry,
* registry
**/
AtkRegistry*
-atk_get_default_registry ()
+atk_get_default_registry (void)
{
if (!default_registry)
- {
- default_registry = atk_registry_new();
- }
+ {
+ default_registry = atk_registry_new ();
+ }
return default_registry;
}
diff --git a/atk/atkutil.h b/atk/atkutil.h
index df3df53..8692386 100755
--- a/atk/atkutil.h
+++ b/atk/atkutil.h
@@ -123,7 +123,6 @@ void atk_focus_tracker_init (AtkEventListenerInit add_function);
/*
* Cause the focus tracker functions which have been specified to be
-F
* executed for the object.
*/
void atk_focus_tracker_notify (AtkObject *object);