[g-a-devel]small at-spi cleanup patch



Hi Guys,

	May I commit ? - and what is going on with the double construct of
spi_base ?	

	Regards,

		Michael.

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/at-spi/ChangeLog,v
retrieving revision 1.132
diff -u -p -u -r1.132 ChangeLog
--- ChangeLog	2002/01/03 20:22:59	1.132
+++ ChangeLog	2002/01/03 22:27:44
@@ -1,3 +1,12 @@
+2002-01-03  Michael Meeks  <michael ximian com>
+
+	* cspi/spi_event.c (SPI_createAccessibleKeySet): dup the
+	keystrings since we free them
+	(SPI_freeAccessibleKeySet): in here.
+
+	* libspi/accessible.c (spi_accessible_new): kill warning,
+	wonder what is going on with the constructor here.
+
 2002-03-01  Bill Haneman <bill haneman sun com>
 
 	* libspi/accessible.c (spi_accessible_new ()) :
Index: cspi/spi_event.c
===================================================================
RCS file: /cvs/gnome/at-spi/cspi/spi_event.c,v
retrieving revision 1.17
diff -u -p -u -r1.17 spi_event.c
--- cspi/spi_event.c	2001/12/15 22:53:57	1.17
+++ cspi/spi_event.c	2002/01/03 22:27:44
@@ -69,7 +69,8 @@ SPI_freeAccessibleKeySet (AccessibleKeyS
  *
  **/
 AccessibleKeySet *
-SPI_createAccessibleKeySet (int len, const char *keysyms, short *keycodes, const char **keystrings)
+SPI_createAccessibleKeySet (int len, const char *keysyms, short *keycodes,
+			    const char **keystrings)
 {
   AccessibleKeySet *keyset = g_new0 (AccessibleKeySet, 1);
   int i, keysym_len = 0;
@@ -93,8 +94,14 @@ SPI_createAccessibleKeySet (int len, con
         {
           keyset->keysyms [i] = 0;
         }
-      if (keycodes) keyset->keycodes [i] = keycodes [i];
-      if (keystrings) keyset->keystrings [i] = keystrings [i];
+      if (keycodes)
+        {
+	  keyset->keycodes [i] = keycodes [i];
+	}
+      if (keystrings)
+        {
+	  keyset->keystrings [i] = g_strdup (keystrings [i]);
+	}
     }
   return keyset;	
 }
Index: libspi/accessible.c
===================================================================
RCS file: /cvs/gnome/at-spi/libspi/accessible.c,v
retrieving revision 1.34
diff -u -p -u -r1.34 accessible.c
--- libspi/accessible.c	2002/01/03 20:23:00	1.34
+++ libspi/accessible.c	2002/01/03 22:27:44
@@ -454,7 +454,7 @@ spi_accessible_new (AtkObject *o)
 
    else if (SPI_IS_REMOTE_OBJECT (o))
      {
-       retval = spi_remote_object_get_accessible (o); 
+       retval = spi_remote_object_get_accessible (SPI_REMOTE_OBJECT (o)); 
      }
    else
      {
@@ -462,6 +462,9 @@ spi_accessible_new (AtkObject *o)
 
        spi_base_construct (SPI_BASE (retval), G_OBJECT(o));
 
+       /* FIXME: What is going on here ! - this looks like we leak an
+	* Atk reference - which could be hiding all manner of evil
+	* reference counting problems. There should be just 1 construct */
        spi_base_construct (SPI_BASE (retval), G_OBJECT(o));
 
        /* aggregate appropriate SPI interfaces based on ATK interfaces */
Index: test/test-simple.c
===================================================================
RCS file: /cvs/gnome/at-spi/test/test-simple.c,v
retrieving revision 1.15
diff -u -p -u -r1.15 test-simple.c
--- test/test-simple.c	2001/12/15 22:54:01	1.15
+++ test/test-simple.c	2002/01/03 22:27:44
@@ -174,7 +174,7 @@ test_action (AccessibleAction *action)
 		fprintf (stderr, "%d: %s (%s);  ", i, s, sd);
 		SPI_freeString (s);
 		SPI_freeString (sd);
-		/* g_assert (AccessibleAction_doAction (action, i)); */
+		g_assert (AccessibleAction_doAction (action, i));
 	}
 	fprintf (stderr, "\n");
 }

-- 
 mmeeks gnu org  <><, Pseudo Engineer, itinerant idiot




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]