+ if (corba_object == CORBA_OBJECT_NIL)
+ {
+ ref = NULL;
+ }
+ else if (!cspi_check_ev ("pre method check"))
+ {
+ ref = NULL;
+ }
+ else
+ {
+ if ((ref = g_hash_table_lookup (get_live_refs (), corba_object)))
+ {
+ g_assert (ref->ref_count > 0);
+ ref->ref_count++;
+ bonobo_object_release_unref (corba_object, NULL);
+#ifdef DEBUG_OBJECTS
+ g_print ("returning cached %p => %p\n", ref, ref->objref);
+#endif
+ }
+ else
+ {
+ ref = g_new (Accessible, 1);
+
+#ifdef DEBUG_OBJECTS
+ g_print ("allocating %p => %p\n", ref, corba_object);
+#endif
+
+ ref->objref = corba_object;
+ ref->ref_count = 1;
+
+ g_hash_table_insert (get_live_refs (), ref->objref, ref);
+ }
+ }