[Ocemp-CVS] papi/src papi_atkobject.c,1.10,1.11
Status: Beta
Brought to you by:
marcusva
From: Marcus v. A. <mar...@us...> - 2007-02-13 08:02:22
|
Update of /cvsroot/ocemp/papi/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23448/src Modified Files: papi_atkobject.c Log Message: Fixed refcounting and state set issues. Index: papi_atkobject.c =================================================================== RCS file: /cvsroot/ocemp/papi/src/papi_atkobject.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- papi_atkobject.c 10 Feb 2007 22:28:22 -0000 1.10 +++ papi_atkobject.c 13 Feb 2007 08:02:20 -0000 1.11 @@ -215,6 +215,9 @@ _construct_object (AtkObject *val) { PyObject *retval; + + debug ("Constructing object...\n"); + if (val) { retval = g_object_get_data (G_OBJECT (val), PAPI_PYOBJECT); @@ -236,6 +239,8 @@ g_free (types); atktype_add_interface_methods (retval, ifaces); } + else + Py_INCREF (retval); return retval; } Py_RETURN_NONE; @@ -903,7 +908,7 @@ pyobj = g_object_get_data (G_OBJECT (obj), PAPI_PYOBJECT); result = PyObject_CallMethod (pyobj, "ref_state_set", NULL); if (!result) - return NULL; + return atk_state_set_new (); /* Returning NULL crashes A11Y apps. */ if (PyObject_TypeCheck (result, &PyAtkStateSet_Type)) retval = ATKSTATESET (result); |