Completed de-registration fix.
authorbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Sun, 30 Sep 2001 21:49:24 +0000 (21:49 +0000)
committerbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Sun, 30 Sep 2001 21:49:24 +0000 (21:49 +0000)
git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@67 e2bd861d-eb25-0410-b326-f6ed22b6b98c

ChangeLog
cspi/spi_main.c
libspi/registry.c
registryd/registry.c

index 683da86..649fd17 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,16 +1,12 @@
 <2001-09-30  Bill Haneman <bill.haneman@sun.com>
-
+       
        * libspi/accessible.c:
                Stubbed-in the implementations for
                        Accessibility_Accessible_getState and
                        Accessibility_Accessible_getRelationSet.
        * libspi/registry.c:
                Improved de-registration process and fixed some bugs, 
-                       deregistration should work correctly
-                       once the compare_object_func()'s CORBA_Object_hash
-                       usage is fixed (currently still broken).
-               (Probably the event listener registration still needs
-                       fixing.)
+                       deregistration now works correctly.
        * libspi/desktop.c:
                Added initialization of applications list (to NULL).
        * util/magnifier.c:
index 027fa23..ffbb447 100644 (file)
@@ -64,8 +64,15 @@ SPI_init (void)
 void
 SPI_event_main (boolean isGNOMEApp)
 {
-  if (isGNOMEApp) bonobo_main();
-  else CORBA_ORB_run (bonobo_orb(), &ev);
+  if (isGNOMEApp) {
+    g_atexit(SPI_exit);
+    bonobo_main();
+  }
+  else {
+    /* TODO: install signal handlers to do cleanup */
+    CORBA_ORB_run (bonobo_orb(), &ev);
+    fprintf (stderr, "orb loop exited...\n");
+  }
 }
 
 /**
@@ -111,6 +118,7 @@ SPI_nextEvent (boolean waitForEvent)
 void
 SPI_exit (void)
 {
+  fprintf (stderr, "bye-bye!\n");      
   exit(0);
 }
 
index 9a61ae1..0f39ed7 100644 (file)
@@ -127,18 +127,15 @@ static gint
 compare_object_hash (gconstpointer p1, gconstpointer p2)
 {
   CORBA_Environment ev;
-  long long diff = ((CORBA_Object_hash ((CORBA_Object) p2, (CORBA_unsigned_long) 0, &ev)) -
-                    (CORBA_Object_hash ((CORBA_Object) p1, (CORBA_unsigned_long) 0, &ev)));
+  gint retval;
+  retval = !CORBA_Object_is_equivalent ((CORBA_Object) p1, (CORBA_Object) p2, &ev);
 
 #ifdef SPI_DEBUG
-  fprintf (stderr, "comparing %p to %p, via hashes %ld and %ld; diff %ld\n",
+  fprintf (stderr, "comparing %p to %p; result %d\n",
           p1, p2,
-          CORBA_Object_hash ((CORBA_Object) p1, (CORBA_unsigned_long) 0, &ev),
-          CORBA_Object_hash ((CORBA_Object) p2, (CORBA_unsigned_long) 0, &ev),
-          (long) diff);
+          retval);
 #endif
-  
-  return ((diff < 0) ? -1 : ((diff > 0) ? 1 : 0));
+  return retval;  
 }
 
 static void
index 9a61ae1..0f39ed7 100644 (file)
@@ -127,18 +127,15 @@ static gint
 compare_object_hash (gconstpointer p1, gconstpointer p2)
 {
   CORBA_Environment ev;
-  long long diff = ((CORBA_Object_hash ((CORBA_Object) p2, (CORBA_unsigned_long) 0, &ev)) -
-                    (CORBA_Object_hash ((CORBA_Object) p1, (CORBA_unsigned_long) 0, &ev)));
+  gint retval;
+  retval = !CORBA_Object_is_equivalent ((CORBA_Object) p1, (CORBA_Object) p2, &ev);
 
 #ifdef SPI_DEBUG
-  fprintf (stderr, "comparing %p to %p, via hashes %ld and %ld; diff %ld\n",
+  fprintf (stderr, "comparing %p to %p; result %d\n",
           p1, p2,
-          CORBA_Object_hash ((CORBA_Object) p1, (CORBA_unsigned_long) 0, &ev),
-          CORBA_Object_hash ((CORBA_Object) p2, (CORBA_unsigned_long) 0, &ev),
-          (long) diff);
+          retval);
 #endif
-  
-  return ((diff < 0) ? -1 : ((diff > 0) ? 1 : 0));
+  return retval;  
 }
 
 static void