From 60ea797aa906619deaaf946e5e4bd8f548d9ad71 Mon Sep 17 00:00:00 2001 From: billh Date: Sun, 30 Sep 2001 21:49:24 +0000 Subject: [PATCH] Completed de-registration fix. git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@67 e2bd861d-eb25-0410-b326-f6ed22b6b98c --- ChangeLog | 8 ++------ cspi/spi_main.c | 12 ++++++++++-- libspi/registry.c | 13 +++++-------- registryd/registry.c | 13 +++++-------- 4 files changed, 22 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 683da86..649fd17 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,16 +1,12 @@ <2001-09-30 Bill Haneman - + * 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: diff --git a/cspi/spi_main.c b/cspi/spi_main.c index 027fa23..ffbb447 100644 --- a/cspi/spi_main.c +++ b/cspi/spi_main.c @@ -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); } diff --git a/libspi/registry.c b/libspi/registry.c index 9a61ae1..0f39ed7 100644 --- a/libspi/registry.c +++ b/libspi/registry.c @@ -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 diff --git a/registryd/registry.c b/registryd/registry.c index 9a61ae1..0f39ed7 100644 --- a/registryd/registry.c +++ b/registryd/registry.c @@ -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 -- 2.7.4