# HG changeset patch # User Mike Ruprecht # Date 1235193328 0 # Node ID cb3c6ec9291e51b99b4ebbd61d40a1be3b814398 # Parent 1830d339f9b90403a95d69d8206eea2941ba7ab1# Parent 9b0761b772185ee1c3207d748fb8bff6524d1f3e merge of '6034e4df300b7da5e8fc3095e128f6215af903ab' and '6f6a810b0411a1e2b7a1bba79dae2b02ea200d19' diff -r 9b0761b77218 -r cb3c6ec9291e pidgin/gtkmedia.c --- a/pidgin/gtkmedia.c Sat Feb 21 05:01:10 2009 +0000 +++ b/pidgin/gtkmedia.c Sat Feb 21 05:15:28 2009 +0000 @@ -58,6 +58,7 @@ GstElement *send_level; GstElement *recv_level; + GtkItemFactory *item_factory; GtkWidget *menubar; GtkWidget *statusbar; @@ -241,7 +242,6 @@ static GtkWidget * setup_menubar(PidginMedia *window) { - GtkItemFactory *item_factory; GtkAccelGroup *accel_group; GtkWidget *menu; @@ -249,19 +249,20 @@ gtk_window_add_accel_group(GTK_WINDOW(window), accel_group); g_object_unref(accel_group); - item_factory = gtk_item_factory_new(GTK_TYPE_MENU_BAR, + window->priv->item_factory = gtk_item_factory_new(GTK_TYPE_MENU_BAR, "
", accel_group); - gtk_item_factory_set_translate_func(item_factory, + gtk_item_factory_set_translate_func(window->priv->item_factory, (GtkTranslateFunc)item_factory_translate_func, NULL, NULL); - gtk_item_factory_create_items(item_factory, menu_item_count, - menu_items, window); + gtk_item_factory_create_items(window->priv->item_factory, + menu_item_count, menu_items, window); g_signal_connect(G_OBJECT(accel_group), "accel-changed", G_CALLBACK(pidgin_save_accels_cb), NULL); - menu = gtk_item_factory_get_widget(item_factory, "
"); + menu = gtk_item_factory_get_widget( + window->priv->item_factory, "
"); gtk_widget_show(menu); return menu; @@ -377,6 +378,11 @@ gtkmedia->priv->media = NULL; } + if (gtkmedia->priv->item_factory) { + g_object_unref(gtkmedia->priv->item_factory); + gtkmedia->priv->item_factory = NULL; + } + if (gtkmedia->priv->send_level) { gst_object_unref(gtkmedia->priv->send_level); gtkmedia->priv->send_level = NULL;