summaryrefslogtreecommitdiff
path: root/panel-menu
diff options
context:
space:
mode:
authorPM PST 2002 chicane <chicane@cox.net>2002-03-30 23:37:51 +0000
committerChris Phelps <chicane@src.gnome.org>2002-03-30 23:37:51 +0000
commit04f5bfbe127ae8be7465c2e3a5a9c74ee1eac2fe (patch)
tree665ecbafcbd9909b2ff836a5faa0d46437cd942b /panel-menu
parentc500a2e74ea10d8201ea12fa919db9fbd674887f (diff)
kill the pixbuf g_atexit() callback, and just call the function from
Sat Mar 30 03:19:51 PM PST 2002 chicane <chicane@cox.net> * panel-menu-pixbuf.[c/h], panel-menu.c: kill the pixbuf g_atexit() callback, and just call the function from applet_destroy() so we dont have massive console output when you kill X or the like. Basically the at_exit function just cleared the cache (which should happen anyway when all menuitems are removed), and killed some gconf connections.
Diffstat (limited to 'panel-menu')
-rw-r--r--panel-menu/ChangeLog9
-rw-r--r--panel-menu/panel-menu-directory.c2
-rw-r--r--panel-menu/panel-menu-pixbuf.c27
-rw-r--r--panel-menu/panel-menu-pixbuf.h5
-rw-r--r--panel-menu/panel-menu.c9
5 files changed, 33 insertions, 19 deletions
diff --git a/panel-menu/ChangeLog b/panel-menu/ChangeLog
index 81bf49846..5ecc8851c 100644
--- a/panel-menu/ChangeLog
+++ b/panel-menu/ChangeLog
@@ -1,3 +1,12 @@
+Sat Mar 30 03:19:51 PM PST 2002 chicane <chicane@cox.net>
+ * panel-menu-pixbuf.[c/h], panel-menu.c:
+ kill the pixbuf g_atexit() callback, and just call
+ the function from applet_destroy() so we dont have massive
+ console output when you kill X or the like.
+ Basically the at_exit function just cleared the cache (which
+ should happen anyway when all menuitems are removed), and killed
+ some gconf connections.
+
Sat Mar 30 02:47:54 PM PST 2002 chicane <chicane@cox.net>
* removed the "Browse..." button from "Path" items and
added it to "Directory" items, because Path items want
diff --git a/panel-menu/panel-menu-directory.c b/panel-menu/panel-menu-directory.c
index fd5676cca..2b3c1ff0c 100644
--- a/panel-menu/panel-menu-directory.c
+++ b/panel-menu/panel-menu-directory.c
@@ -305,10 +305,8 @@ panel_menu_directory_destroy (PanelMenuEntry *entry)
g_return_if_fail (entry->type == PANEL_MENU_TYPE_DIRECTORY);
directory = (PanelMenuDirectory *) entry->data;
- g_print ("beginning directory item removall\n");
if (directory->monitor)
gnome_vfs_monitor_cancel (directory->monitor);
- g_print ("removed vfs-monitor\n");
if (directory->name)
g_free (directory->name);
if (directory->path)
diff --git a/panel-menu/panel-menu-pixbuf.c b/panel-menu/panel-menu-pixbuf.c
index eb6d2ea40..de4a39b50 100644
--- a/panel-menu/panel-menu-pixbuf.c
+++ b/panel-menu/panel-menu-pixbuf.c
@@ -76,7 +76,7 @@ static guint nautilus_connection = 0;
static guint icon_connection = 0;
static gint icon_size = 0;
-static void
+void
panel_menu_pixbuf_init (void)
{
if (pixbuf_cache == NULL) {
@@ -98,17 +98,19 @@ panel_menu_pixbuf_init (void)
register_gconf_notifications ();
setup_default_icons ();
panel_menu_pixbuf_setup_nautilus_icons ();
- g_atexit (panel_menu_pixbuf_exit);
}
}
-static void
+void
panel_menu_pixbuf_exit (void)
{
if (pixbuf_cache) {
- g_hash_table_foreach_remove (pixbuf_cache,
- (GHRFunc)pixbuf_cache_remove,
- NULL);
+ /*
+ Don't bother killing the pixmaps
+ They should die on their own as menu items
+ unreference them, or it wont matter because
+ we've been killed explicitly.
+ */
g_hash_table_destroy (pixbuf_cache);
pixbuf_cache = NULL;
}
@@ -120,8 +122,10 @@ panel_menu_pixbuf_exit (void)
gconf_client_notify_remove (gconf_client,
icon_connection);
}
- g_object_unref (G_OBJECT (gconf_client));
- gconf_client = NULL;
+ if (gconf_client) {
+ g_object_unref (G_OBJECT (gconf_client));
+ gconf_client = NULL;
+ }
}
static void
@@ -145,13 +149,6 @@ register_gconf_notifications (void)
(GFreeFunc) NULL, NULL);
}
-static gboolean
-pixbuf_cache_remove (gpointer key, gpointer value, gpointer user_data)
-{
- panel_menu_pixbuf_entry_remove ((PixbufEntry *)value);
- return TRUE;
-}
-
gint
panel_menu_pixbuf_get_icon_size (void)
{
diff --git a/panel-menu/panel-menu-pixbuf.h b/panel-menu/panel-menu-pixbuf.h
index 44f724c0f..74e863749 100644
--- a/panel-menu/panel-menu-pixbuf.h
+++ b/panel-menu/panel-menu-pixbuf.h
@@ -27,6 +27,11 @@
G_BEGIN_DECLS
+/* Don't need to call this, we check later when a pixmap is asked for */
+void panel_menu_pixbuf_init (void);
+/* Please call this, it free's memory and stuff */
+void panel_menu_pixbuf_exit (void);
+
gint panel_menu_pixbuf_get_icon_size (void);
void panel_menu_pixbuf_set_icon_size (gint size);
diff --git a/panel-menu/panel-menu.c b/panel-menu/panel-menu.c
index e258a8f8f..6c5c56c35 100644
--- a/panel-menu/panel-menu.c
+++ b/panel-menu/panel-menu.c
@@ -600,8 +600,10 @@ applet_destroy_cb (GtkWidget *widget, PanelMenu *panel_menu)
entry = (PanelMenuEntry *) cur->data;
panel_menu_common_call_entry_destroy (entry);
}
- if (panel_menu->entries)
+ if (panel_menu->entries) {
g_list_free (panel_menu->entries);
+ }
+ panel_menu_pixbuf_exit ();
g_free (panel_menu);
}
@@ -679,7 +681,10 @@ applet_about_cb (BonoboUIComponent *uic, PanelMenu *panel_menu,
pixbuf = gdk_pixbuf_new_from_file (file, NULL);
}
- about = gnome_about_new (_("PanelMenu Applet"), "0.0.1", _("(c) 2001 Chris Phelps"), _("The Panel Menu Applet allows you to display customized menubars on your panels."), authors, NULL, /* documenters */
+ about = gnome_about_new (_("PanelMenu Applet"), "0.0.1",
+ _("(c) 2001 Chris Phelps"),
+ _("The Panel Menu Applet allows you to display customized menubars on your panels."),
+ authors, NULL, /* documenters */
NULL, /* translator_credits */
pixbuf);