Fixed bug 85980.
authorbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Thu, 20 Jun 2002 12:10:35 +0000 (12:10 +0000)
committerbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Thu, 20 Jun 2002 12:10:35 +0000 (12:10 +0000)
git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@323 e2bd861d-eb25-0410-b326-f6ed22b6b98c

ChangeLog
cspi/bonobo/cspi-bonobo.c
cspi/cspi-lowlevel.h
cspi/spi_main.c

index 9b88d37..94f7aaf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,28 @@
+2002-06-20  Bill Haneman  <bill.haneman@sun.com>
+
+       * cspi/spi_main.c: [fix for bug 85980]
+       (cspi_object_ref):
+       Replaced use of bonobo_object_dup_ref with call to the wrapper
+       method, csou_dup_ref (); this silences a compiler warning and
+       provided more portability.
+       (cspi_registry):
+       Ping the registry before return, and restart if necessary.
+
+       * cspi/bonobo/cspi-bonobo.c:
+       (cspi_ping):
+       New internal method.
+       (cspi_dup_ref):
+       Fixed this method to return an object reference, as it should have
+       all along.
+
+       * cspi/cspi-lowlevel.h:
+       Added internal definition for cspi_ping() and fixed 
+       return type of cspi_dup_ref().
+       
+
 2002-06-19  Bill Haneman  <bill.haneman@sun.com>
 
-       * atk-bridge/bridge.c:  [partial fix for bug 85305]
+       * atk-bridge/bridge.c:  [fix for bug 85305]
        (spi_atk_bridge_register_application):
        New method where the initial application registry calls have been
        moved; it allows an application to re-register in response to
index eb51feb..0d94057 100644 (file)
 #include <libbonobo.h>
 #include "../cspi-lowlevel.h"
 
-void
+CORBA_Object
 cspi_dup_ref (CORBA_Object object)
 {
-  bonobo_object_dup_ref (object, NULL);
+  return bonobo_object_dup_ref (object, NULL);
 }
 
 void
@@ -109,6 +109,12 @@ cspi_init (void)
   return registry;
 }
 
+SPIBoolean
+cspi_ping (CORBA_Object object)
+{
+       return bonobo_unknown_ping (object, NULL);
+}
+
 void
 cspi_main (void)
 {
index ee94f94..9c5a0c4 100644 (file)
 /* Misc CORBA / bonobo bits */
 
 SPIBoolean   cspi_check_ev           (const char *error_string);
-void         cspi_dup_ref            (CORBA_Object object);
+CORBA_Object cspi_dup_ref            (CORBA_Object object);
 void         cspi_release_unref      (CORBA_Object object);
 char        *cspi_exception_get_text (void);
 CORBA_Object cspi_init               (void);
+SPIBoolean   cspi_ping               (CORBA_Object object);
 void         cspi_main               (void);
 void         cspi_main_quit          (void);
 
index 6cf1924..21ab64a 100644 (file)
@@ -128,13 +128,14 @@ cspi_get_live_refs (void)
 CORBA_Environment *
 cspi_ev (void)
 {
-  /* This method is an ugly hack */
   return &ev;
 }
 
 Accessibility_Registry
 cspi_registry (void)
 {
+  if (!cspi_ping (registry))
+         registry = cspi_init ();
   return registry;
 }
 
@@ -238,8 +239,8 @@ cspi_object_ref (Accessible *accessible)
   g_return_if_fail (accessible != NULL);
 
   if (g_hash_table_lookup (cspi_get_live_refs (), accessible->objref) == NULL) {
-         accessible->objref = bonobo_object_dup_ref (accessible->objref, cspi_ev ());
-         g_hash_table_insert (cspi_get_live_refs (), accessible->objref, accessible);    
+         accessible->objref = cspi_dup_ref (accessible->objref);
+         g_hash_table_insert (cspi_get_live_refs (), accessible->objref, accessible);
   } else {
          accessible->ref_count++;
   }