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

rpms/gnome-panel/FC-4 gnome-panel-2.10.1-fix-recent-items-crash.patch, 1.1, 1.2 gnome-panel.spec, 1.69, 1.70



Author: markmc

Update of /cvs/dist/rpms/gnome-panel/FC-4
In directory cvs.devel.redhat.com:/tmp/cvs-serv3182

Modified Files:
	gnome-panel-2.10.1-fix-recent-items-crash.patch 
	gnome-panel.spec 
Log Message:
* Tue Jul 26 2005 Mark McLoughlin <markmc redhat com> 2.10.1-10.2
- Backport fix for recent-files memory leak - thanks to Erwin Rol
  for tracking this down (rh #160137)


gnome-panel-2.10.1-fix-recent-items-crash.patch:
 ChangeLog             |   33 +++++++++++++++++++++++++++++++
 egg-recent-model.c    |    6 +++++
 egg-recent-view-gtk.c |   16 +++++++++------
 panel-menu-items.c    |   15 ++++++++++----
 panel-recent.c        |   52 +++++++++++++++++++++++++++-----------------------
 panel-recent.h        |    9 +++++++-
 6 files changed, 97 insertions(+), 34 deletions(-)

Index: gnome-panel-2.10.1-fix-recent-items-crash.patch
===================================================================
RCS file: /cvs/dist/rpms/gnome-panel/FC-4/gnome-panel-2.10.1-fix-recent-items-crash.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- gnome-panel-2.10.1-fix-recent-items-crash.patch	4 May 2005 15:00:26 -0000	1.1
+++ gnome-panel-2.10.1-fix-recent-items-crash.patch	26 Jul 2005 13:37:50 -0000	1.2
@@ -1,15 +1,41 @@
---- gnome-panel-2.10.1/gnome-panel/panel-recent.c.fix-recent-items-crash	2005-05-04 15:44:22.000000000 +0100
-+++ gnome-panel-2.10.1/gnome-panel/panel-recent.c	2005-05-04 15:44:34.000000000 +0100
-@@ -234,7 +234,6 @@
- 				 menu_item, 0);
- 
- 	view = egg_recent_view_gtk_new (menu, NULL);
--	g_object_unref (G_OBJECT (menu));
- 
- 	egg_recent_view_gtk_set_tooltip_func (view,
- 					      recent_documents_tooltip_func,
---- gnome-panel-2.10.1/gnome-panel/egg-recent-model.c.fix-recent-items-crash	2005-05-04 15:42:57.000000000 +0100
-+++ gnome-panel-2.10.1/gnome-panel/egg-recent-model.c	2005-05-04 15:43:48.000000000 +0100
+--- gnome-panel-2.10.1/gnome-panel/ChangeLog.fix-recent-items-crash	2005-04-03 14:13:45.000000000 -0400
++++ gnome-panel-2.10.1/gnome-panel/ChangeLog	2005-07-26 09:34:46.000000000 -0400
+@@ -0,0 +1,33 @@
++2005-05-04  Mark McLoughlin  <mark skynet ie>
++
++	Fix crasher with recent items menu - bug #170660
++
++	* egg-recent-model.c:
++	(egg_recent_model_changed_timeout): set timeout id
++	to zero.
++	(egg_recent_model_finalize): remove the timeout if
++	it is still around.
++
++2005-05-02  Mark McLoughlin  <mark skynet ie>
++	
++	Change things around so that we don't 1) slave the lifecycle
++	of the EggRecentViewGtk to the menu it manages, 2) incorrectly
++	unref the menu after creating the view and 3) take a ref on
++	the menu in EggRecentViewgtk.
++
++	* panel-recent.[ch]: (panel_recent_append_documents_menu):
++	Re-work so that it returns the newly created EggRecentViewGtk
++	and allows it to be re-used by passing it back in as a parameter.
++	
++	* panel-menu-items.c:
++	(panel_place_menu_item_create_menu): hold a ref on the
++	EggRecentViewGtk and re-user when re-creating the menu.
++	(panel_place_menu_item_finalize): unref the view.
++	
++	* egg-recent-view-gtk.c:
++	(egg_recent_view_gtk_clear),
++	(egg_recent_view_gtk_set_list): don't barf if view->menu is NULL.
++	(egg_recent_view_gtk_finalize): don't unref the menu.
++	(egg_recent_view_gtk_set_menu): don't take a ref on the menu.
++	There's no point in us updating a menu which has been destroyed.
++
+--- gnome-panel-2.10.1/gnome-panel/egg-recent-model.c.fix-recent-items-crash	2005-03-07 09:15:16.000000000 -0500
++++ gnome-panel-2.10.1/gnome-panel/egg-recent-model.c	2005-07-26 09:34:46.000000000 -0400
 @@ -643,6 +643,8 @@
  static gboolean
  egg_recent_model_changed_timeout (EggRecentModel *model)
@@ -30,3 +56,208 @@
  	egg_recent_model_monitor (model, FALSE);
  
  
+--- gnome-panel-2.10.1/gnome-panel/egg-recent-view-gtk.c.fix-recent-items-crash	2005-03-07 09:15:16.000000000 -0500
++++ gnome-panel-2.10.1/gnome-panel/egg-recent-view-gtk.c	2005-07-26 09:34:46.000000000 -0400
+@@ -99,7 +99,8 @@
+ 	GObject *menu_item;
+ 	gint *menu_data=NULL;
+ 
+-	g_return_if_fail (view->menu != NULL);
++	if (view->menu == NULL)
++		return;
+ 
+ 	menu_children = gtk_container_get_children (GTK_CONTAINER (view->menu));
+ 
+@@ -336,7 +337,8 @@
+ 	gint display=1;
+ 	gint index=1;
+ 
+-	g_return_if_fail (view);
++	if (view->menu == NULL)
++		return;
+ 
+ 	egg_recent_view_gtk_clear (view);
+ 
+@@ -497,7 +499,6 @@
+ 
+ 	g_free (view->uid);
+ 
+-	g_object_unref (view->menu);
+ 	g_object_unref (view->model);
+ #ifndef USE_STABLE_LIBGNOMEUI
+ 	g_object_unref (view->theme);
+@@ -695,13 +696,16 @@
+ {
+ 	g_return_if_fail (view);
+ 	g_return_if_fail (EGG_IS_RECENT_VIEW_GTK (view));
+-	g_return_if_fail (menu);
+ 
+ 	if (view->menu != NULL)
+-		g_object_unref (view->menu);
++		g_object_remove_weak_pointer (G_OBJECT (view->menu),
++					      (gpointer *) &view->menu);
+ 	
+ 	view->menu = menu;
+-	g_object_ref (view->menu);
++
++	if (view->menu != NULL)
++		g_object_add_weak_pointer (G_OBJECT (view->menu),
++					   (gpointer *) &view->menu);
+ }
+ 
+ /**
+--- gnome-panel-2.10.1/gnome-panel/panel-menu-items.c.fix-recent-items-crash	2005-07-26 09:32:12.000000000 -0400
++++ gnome-panel-2.10.1/gnome-panel/panel-menu-items.c	2005-07-26 09:34:46.000000000 -0400
+@@ -61,6 +61,8 @@
+ 	GtkWidget   *menu;
+ 	PanelWidget *panel;
+ 
++	EggRecentViewGtk *recent_view;
++
+ 	GnomeVFSMonitorHandle *bookmarks_monitor;
+ 
+ 	gulong       volume_mounted_id;
+@@ -465,7 +467,7 @@
+ 
+ 
+ static GtkWidget *
+-panel_place_menu_item_create_menu (void)
++panel_place_menu_item_create_menu (EggRecentViewGtk **recent_view)
+ {
+ 	GtkWidget *places_menu;
+ 	GtkWidget *item;
+@@ -514,7 +516,8 @@
+ 	panel_menu_items_append_from_desktop (places_menu,
+ 					      "gnome-search-tool.desktop");
+ 
+-	panel_recent_append_documents_menu (places_menu);
++	*recent_view = panel_recent_append_documents_menu (places_menu,
++							   *recent_view);
+ 
+ 	return places_menu;
+ }
+@@ -528,7 +531,7 @@
+ 
+ 	if (place_item->priv->menu) {
+ 		gtk_widget_destroy (place_item->priv->menu);
+-		place_item->priv->menu = panel_place_menu_item_create_menu ();
++		place_item->priv->menu = panel_place_menu_item_create_menu (&place_item->priv->recent_view);
+ 		gtk_menu_item_set_submenu (GTK_MENU_ITEM (place_item),
+ 					   place_item->priv->menu);
+ 		panel_applet_menu_set_recurse (GTK_MENU (place_item->priv->menu),
+@@ -641,6 +644,10 @@
+ 				 DESKTOP_IS_HOME_DIR_DIR,
+ 				 NULL);
+ 
++	if (menuitem->priv->recent_view != NULL)
++		g_object_unref (menuitem->priv->recent_view);
++	menuitem->priv->recent_view = NULL;
++
+ 	if (menuitem->priv->bookmarks_monitor != NULL)
+ 		gnome_vfs_monitor_cancel (menuitem->priv->bookmarks_monitor);
+ 	menuitem->priv->bookmarks_monitor = NULL;
+@@ -833,7 +840,7 @@
+ 					       image);
+ 	}
+ 
+-	menuitem->priv->menu = panel_place_menu_item_create_menu ();
++	menuitem->priv->menu = panel_place_menu_item_create_menu (&menuitem->priv->recent_view);
+ 	gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem),
+ 				   menuitem->priv->menu);
+ 
+--- gnome-panel-2.10.1/gnome-panel/panel-recent.c.fix-recent-items-crash	2005-03-07 09:15:16.000000000 -0500
++++ gnome-panel-2.10.1/gnome-panel/panel-recent.c	2005-07-26 09:34:46.000000000 -0400
+@@ -203,13 +203,13 @@
+ 	g_free (tooltip);
+ }
+ 
+-void
+-panel_recent_append_documents_menu (GtkWidget *top_menu)
++EggRecentViewGtk *
++panel_recent_append_documents_menu (GtkWidget        *top_menu,
++				    EggRecentViewGtk *view)
+ {
+-	GtkWidget        *menu;
+-	GtkWidget        *menu_item;
+-	EggRecentModel   *model;
+-	EggRecentViewGtk *view;
++	GtkWidget      *menu;
++	GtkWidget      *menu_item;
++	EggRecentModel *model;
+ 
+ 	menu_item = gtk_image_menu_item_new ();
+ 	setup_menu_item_with_icon (menu_item,
+@@ -227,18 +227,29 @@
+ 	gtk_menu_shell_append (GTK_MENU_SHELL (top_menu), menu_item);
+ 	gtk_widget_show_all (menu_item);
+ 	
+-	/* a model that shows the global recent doc list */
+-	model = egg_recent_model_new (EGG_RECENT_MODEL_SORT_MRU);
++	if (!view) {
++		/* a model that shows the global recent doc list */
++		model = egg_recent_model_new (EGG_RECENT_MODEL_SORT_MRU);
++		view = egg_recent_view_gtk_new (menu, NULL);
++
++		egg_recent_view_gtk_set_tooltip_func (view,
++						      recent_documents_tooltip_func,
++						      NULL);
++
++		egg_recent_view_gtk_show_numbers (view, FALSE);
++		egg_recent_view_set_model (EGG_RECENT_VIEW (view), model);
++		egg_recent_view_gtk_set_icon_size (view, panel_menu_icon_get_size ());
++	} else {
++		egg_recent_view_gtk_set_menu (view, menu);
++		model = egg_recent_view_get_model (EGG_RECENT_VIEW (view));
++		g_object_ref (model);
++	}
++
+ 	g_signal_connect_object (model, "changed",
+ 				 G_CALLBACK (panel_recent_model_changed_cb),
+ 				 menu_item, 0);
++	g_object_unref (model);
+ 
+-	view = egg_recent_view_gtk_new (menu, NULL);
+-	g_object_unref (G_OBJECT (menu));
+-
+-	egg_recent_view_gtk_set_tooltip_func (view,
+-					      recent_documents_tooltip_func,
+-					      NULL);
+ 	add_menu_separator (menu);
+ 
+ 	menu_item = gtk_image_menu_item_new ();
+@@ -258,14 +269,9 @@
+ 			  G_CALLBACK (recent_documents_clear_cb),
+ 			  model);
+ 
+-	g_signal_connect (view, "activate",
+-			  G_CALLBACK (recent_documents_activate_cb),
+-			  menu);
+-	egg_recent_view_gtk_show_numbers (view, FALSE);
+-	egg_recent_view_set_model (EGG_RECENT_VIEW (view), model);
+-	egg_recent_view_gtk_set_icon_size (view, panel_menu_icon_get_size ());
+-	g_object_unref (G_OBJECT (model));
++	g_signal_connect_object (view, "activate",
++				 G_CALLBACK (recent_documents_activate_cb),
++				 menu, 0);
+ 
+-	g_object_set_data_full (G_OBJECT (menu), "recent-view",
+-				view, g_object_unref);
++	return view;
+ }
+--- gnome-panel-2.10.1/gnome-panel/panel-recent.h.fix-recent-items-crash	2005-01-14 14:26:10.000000000 -0500
++++ gnome-panel-2.10.1/gnome-panel/panel-recent.h	2005-07-26 09:34:46.000000000 -0400
+@@ -25,6 +25,13 @@
+ #ifndef __PANEL_RECENT_H__
+ #define __PANEL_RECENT_H__
+ 
+-void panel_recent_append_documents_menu (GtkWidget *menu);
++#include "egg-recent-view-gtk.h"
++
++G_BEGIN_DECLS
++
++EggRecentViewGtk *panel_recent_append_documents_menu (GtkWidget        *menu,
++						      EggRecentViewGtk *view);
++
++G_END_DECLS
+ 
+ #endif /* __PANEL_RECENT_H__ */


Index: gnome-panel.spec
===================================================================
RCS file: /cvs/dist/rpms/gnome-panel/FC-4/gnome-panel.spec,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -r1.69 -r1.70
--- gnome-panel.spec	28 Jun 2005 12:44:09 -0000	1.69
+++ gnome-panel.spec	26 Jul 2005 13:37:50 -0000	1.70
@@ -23,7 +23,7 @@
 Summary: GNOME panel
 Name: gnome-panel
 Version: 2.10.1
-Release: 10.1
+Release: 10.2
 URL: http://www.gnome.org
 Source0: ftp://ftp.gnome.org/pub/GNOME/pre-gnome2/sources/gnome-panel/%{name}-%{version}.tar.bz2
 Source1: redhat-panel-default-setup.entries
@@ -243,6 +243,10 @@
 %{_datadir}/gtk-doc
 
 %changelog
+* Tue Jul 26 2005 Mark McLoughlin <markmc redhat com> 2.10.1-10.2
+- Backport fix for recent-files memory leak - thanks to Erwin Rol
+  for tracking this down (rh #160137)
+
 * Mon Jun 27 2005 Mark McLoughlin <markmc redhat com> 2.10.1-10.1
 - Fix "panel doesn't notice new screen size" issue (bug #160439)
 


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