+2003-09-01 Padraig O'Briain <padraig.obriain@sun.com>
+
+ * cspi/spi_main.c (cspi_object_return): Ensure that reference count is
+ not decremented to zero. Fixes bug #120725.
+
2003-08-30 KAMAGASAKO Masatoshi <emerald@gnome.gr.jp>
* configure.in: Added "ja" to ALL_LINGUAS.
void
cspi_object_return (Accessible *accessible)
{
+ int old_ref_count;
g_return_if_fail (accessible != NULL);
if (!accessible->on_loan ||
else /* Convert to a permanant ref */
{
accessible->on_loan = FALSE;
+ old_ref_count = accessible->ref_count;
accessible->objref = cspi_dup_ref (accessible->objref);
- accessible->ref_count--;
+ if (old_ref_count != accessible->ref_count &&
+ accessible->ref_count == 1)
+ {
+ cspi_object_unref (accessible);
+ }
+ else
+ {
+ accessible->ref_count--;
+ }
}
}