Index: components/html-editor/spellchecker.c
===================================================================
--- components/html-editor/spellchecker.c	(revision 8509)
+++ components/html-editor/spellchecker.c	(working copy)
@@ -269,6 +269,7 @@
 
 	if (control) {
 		g_object_ref_sink (control);
+		g_object_unref (control);
 	}
 	return rv;
 }
Index: components/html-editor/ChangeLog
===================================================================
--- components/html-editor/ChangeLog	(revision 8509)
+++ components/html-editor/ChangeLog	(working copy)
@@ -1,3 +1,12 @@
+2007-08-08  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #394182
+
+	* spellchecker.c: (spell_has_control): Free/unref control too.
+	* popup.c: (prepare_properties_and_menu), (popup_show),
+	(popup_show_at_cursor), (property_dialog_show):
+	Free/unref menu when necessary.
+
 2007-08-06  Srinivasa Ragavan  <sragavan@novell.com>
 
 	** Fix for bug #432914
Index: components/html-editor/popup.c
===================================================================
--- components/html-editor/popup.c	(revision 8509)
+++ components/html-editor/popup.c	(working copy)
@@ -585,8 +585,9 @@
 					      GTK_MENU_SHELL (menu));
 	END_SUBMENU;
 
+	g_object_ref_sink (menu);
 	if (*items == 0) {
-		g_object_ref_sink (menu);
+		g_object_unref (menu);
 		menu = NULL;
 	} else
 		gtk_widget_show (menu);
@@ -606,6 +607,9 @@
 		gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL,
 				event ? event->button : 0, event ? event->time : 0);
 
+	if (menu)
+		g_object_unref (menu);
+
 	return (items > 0);
 }
 
@@ -629,10 +633,13 @@
 	guint items, props;
 
 	menu = prepare_properties_and_menu (cd, &items, &props);
-	gtk_widget_show (menu);
+
 	if (items)
 		gtk_menu_popup (GTK_MENU (menu), NULL, NULL, set_position, cd, 0, 0);
 
+	if (menu)
+		g_object_unref (menu);
+
 	return (items > 0);
 }
 
@@ -643,7 +650,10 @@
 	guint items, props;
 
 	menu = prepare_properties_and_menu (cd, &items, &props);
-	g_object_ref_sink (menu);
+
+	if (menu)
+		g_object_unref (menu);
+
 	if (props)
 		show_prop_dialog (cd, GTK_HTML_EDIT_PROPERTY_NONE);
 }
