Add weak reference so we do not leak the accessible when the object dies.
authorPadraig O'Briain <padraig.obriain@sun.com>
Tue, 4 Feb 2003 12:53:13 +0000 (12:53 +0000)
committerPadraig O'Briain <padraigo@src.gnome.org>
Tue, 4 Feb 2003 12:53:13 +0000 (12:53 +0000)
2003-02-04  Padraig O'Briain  <padraig.obriain@sun.com>

* atk/atkgobjectaccessible.c (atk_gobject_accessible_for_object):
Add weak reference so we do not leak the accessible when the object
dies. Problem reported by Alex Larsson.

ChangeLog
atk/atkgobjectaccessible.c

index fb34bd9..59a0d2f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-02-04  Padraig O'Briain  <padraig.obriain@sun.com>
+
+       * atk/atkgobjectaccessible.c (atk_gobject_accessible_for_object):
+       Add weak reference so we do not leak the accessible when the object
+       dies. Problem reported by Alex Larsson.
+
 2003-02-02  Fatih Demir <kabalak@gtranslator.org>
 
        * configure.in: Added "tr" (Turkish) to the languages' list.
index 41b4def..4267c50 100644 (file)
@@ -91,6 +91,9 @@ atk_gobject_accessible_for_object (GObject *obj)
            * The AtkObject which was created was not a AtkGObjectAccessible
            */
           quark_accessible_object = g_quark_from_static_string ("accessible-object");
+          g_object_weak_ref (obj,
+                             (GWeakNotify) g_object_unref,
+                             accessible); 
         }
       g_object_set_qdata (obj, quark_accessible_object, accessible);
     }