[evolution-patches] new editor leak patch.



This is the current version of my changes for the editor leaks waiting
approval.

--Larry 

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/components/html-editor/ChangeLog,v
retrieving revision 1.407
diff -u -p -r1.407 ChangeLog
--- ChangeLog	5 Jun 2003 21:32:32 -0000	1.407
+++ ChangeLog	13 Jun 2003 16:57:28 -0000
@@ -1,3 +1,21 @@
+2003-06-13  Larry Ewing  <lewing ximian com>
+
+	* editor-control-factory.c (send_event_void): unref all return
+	values.
+
+	* spell.c (spell_create_language_menu): make sure we don't
+	overwrite languages without freeing it.
+
+	* control-data.c (gtk_html_control_data_destroy): free the
+	languages.
+
+	* Makefile.am: Use imlcit rules to generate the .server files. 
+
+2003-06-10  Larry Ewing  <lewing ximian com>
+
+	* editor-control-factory.c (send_event_str): free the bonobo arg
+	the right way.
+
 2003-06-05  Radek Doulik  <rodo ximian com>
 
 	* GNOME_GtkHTML_Editor.xml.in: changed increase/decrease indent
Index: control-data.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/components/html-editor/control-data.c,v
retrieving revision 1.20
diff -u -p -r1.20 control-data.c
--- control-data.c	12 May 2003 20:46:48 -0000	1.20
+++ control-data.c	13 Jun 2003 16:57:28 -0000
@@ -76,5 +76,8 @@ gtk_html_control_data_destroy (GtkHTMLCo
 	if (cd->gdk_painter) 
 		g_object_unref (cd->gdk_painter);
 
+	if (cd->languages)
+		CORBA_free (cd->languages);
+
 	g_free (cd);
 }
Index: spell.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/components/html-editor/spell.c,v
retrieving revision 1.40
diff -u -p -r1.40 spell.c
--- spell.c	9 Apr 2003 11:10:38 -0000	1.40
+++ spell.c	13 Jun 2003 16:57:28 -0000
@@ -341,6 +341,9 @@ spell_create_language_menu (GtkHTMLContr
 	if (cd->dict == CORBA_OBJECT_NIL)
 		return;
 
+	if (cd->languages)
+		CORBA_free (cd->languages);
+
 	CORBA_exception_init (&ev);
 	cd->languages = seq = GNOME_Spell_Dictionary_getLanguages (cd->dict, &ev);
 
Index: editor-control-factory.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/components/html-editor/editor-control-factory.c,v
retrieving revision 1.130
diff -u -p -r1.130 editor-control-factory.c
--- editor-control-factory.c	20 May 2003 19:58:15 -0000	1.130
+++ editor-control-factory.c	13 Jun 2003 16:57:29 -0000
@@ -674,7 +674,7 @@ send_event_str (GNOME_GtkHTML_Editor_Eng
 	/* printf ("sending to listener\n"); */
 	CORBA_exception_init (&ev);
 	bonobo_retval = GNOME_GtkHTML_Editor_Listener_event (listener, name, bonobo_arg, &ev);
-	CORBA_free (bonobo_arg);
+	bonobo_arg_release (bonobo_arg);
 
 	if (ev._major == CORBA_NO_EXCEPTION) {
 		if (!bonobo_arg_type_is_equal (bonobo_retval->_type, TC_null, &ev)
@@ -695,11 +695,15 @@ send_event_void (GNOME_GtkHTML_Editor_En
 {
 	CORBA_Environment ev;
 	CORBA_any *any;
+	CORBA_any *retval;
 
 	any = CORBA_any_alloc ();
 	any->_type = TC_null;
 	CORBA_exception_init (&ev);
-	GNOME_GtkHTML_Editor_Listener_event (listener, name, any, &ev);
+	retval = GNOME_GtkHTML_Editor_Listener_event (listener, name, any, &ev);
+	if (!BONOBO_EX (&ev))
+	    CORBA_free (retval);
+
 	CORBA_exception_free (&ev);
 	CORBA_free (any);
 }
@@ -712,6 +716,7 @@ send_event_stream (GNOME_GtkHTML_Editor_
 		   GtkHTMLStream *stream) 
 {
 	CORBA_any *any;
+	CORBA_any *retval;
 	GNOME_GtkHTML_Editor_URLRequestEvent e;
 	CORBA_Environment ev;
 	BonoboObject *bstream;
@@ -725,7 +730,9 @@ send_event_stream (GNOME_GtkHTML_Editor_
 	e.stream = BONOBO_OBJREF (bstream);
 	
 	CORBA_exception_init (&ev);
-	GNOME_GtkHTML_Editor_Listener_event (listener, name, any, &ev);
+	retval = GNOME_GtkHTML_Editor_Listener_event (listener, name, any, &ev);
+	if (!BONOBO_EX (&ev))
+	    CORBA_free (retval);
 
 	bonobo_object_unref (BONOBO_OBJECT (bstream));
 	CORBA_exception_free (&ev);


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