[nautilus-actions] Fix icon combobox memory leaks in Action tab
- From: Pierre Wieser <pwieser src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [nautilus-actions] Fix icon combobox memory leaks in Action tab
- Date: Mon, 26 Oct 2009 18:19:07 +0000 (UTC)
commit fbe29b1c0d811a16593eb11f8311f861e715598b
Author: Pierre Wieser <pwieser trychlos org>
Date: Mon Oct 26 06:18:32 2009 +0100
Fix icon combobox memory leaks in Action tab
Unref model after having initialized the icon combobox.
Clear the list store on dialog dispose.
ChangeLog | 5 +++++
src/nact/nact-iaction-tab.c | 19 ++++++++++++++++++-
2 files changed, 23 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9143b03..7505b4d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2009-10-26 Pierre Wieser <pwieser trychlos org>
+ * src/nact/nact-iaction-tab.c
+ (nact_iaction_tab_initial_load_toplevel):
+ Unref model after having initialized the combobox listview.
+ (release_icon_combobox): Clear the list store in dialog dispose.
+
* src/nact/nact-icommand-tab.c:
* src/nact/nact-icommand-tab.h (nact_icommand_tab_has_label):
Remove unused function.
diff --git a/src/nact/nact-iaction-tab.c b/src/nact/nact-iaction-tab.c
index 1a4591a..1eb97b4 100644
--- a/src/nact/nact-iaction-tab.c
+++ b/src/nact/nact-iaction-tab.c
@@ -96,6 +96,7 @@ static void on_icon_browse( GtkButton *button, NactIActionTab *instance
static void on_icon_changed( GtkEntry *entry, NactIActionTab *instance );
static gint sort_stock_ids( gconstpointer a, gconstpointer b );
static gchar *strip_underscore( const gchar *text );
+static void release_icon_combobox( NactIActionTab *instance );
static GtkButton *get_enabled_button( NactIActionTab *instance );
static void on_enabled_toggled( GtkToggleButton *button, NactIActionTab *instance );
@@ -172,6 +173,7 @@ nact_iaction_tab_initial_load_toplevel( NactIActionTab *instance )
{
static const gchar *thisfn = "nact_iaction_tab_initial_load_toplevel";
GtkWidget *icon_widget;
+ GtkTreeModel *model;
g_debug( "%s: instance=%p", thisfn, ( void * ) instance );
g_return_if_fail( NACT_IS_IACTION_TAB( instance ));
@@ -179,7 +181,9 @@ nact_iaction_tab_initial_load_toplevel( NactIActionTab *instance )
if( st_initialized && !st_finalized ){
icon_widget = base_window_get_widget( BASE_WINDOW( instance ), "ActionIconComboBoxEntry" );
- gtk_combo_box_set_model( GTK_COMBO_BOX( icon_widget ), create_stock_icon_model());
+ model = create_stock_icon_model();
+ gtk_combo_box_set_model( GTK_COMBO_BOX( icon_widget ), model );
+ g_object_unref( model );
icon_combo_list_fill( GTK_COMBO_BOX_ENTRY( icon_widget ));
}
}
@@ -302,6 +306,8 @@ nact_iaction_tab_dispose( NactIActionTab *instance )
g_return_if_fail( NACT_IS_IACTION_TAB( instance ));
if( st_initialized && !st_finalized ){
+
+ release_icon_combobox( instance );
}
}
@@ -880,6 +886,17 @@ strip_underscore( const gchar *text )
return( result );
}
+static void
+release_icon_combobox( NactIActionTab *instance )
+{
+ GtkWidget *combo;
+ GtkTreeModel *model;
+
+ combo = base_window_get_widget( BASE_WINDOW( instance ), "ActionIconComboBoxEntry" );
+ model = gtk_combo_box_get_model( GTK_COMBO_BOX( combo ));
+ gtk_list_store_clear( GTK_LIST_STORE( model ));
+}
+
static GtkButton *
get_enabled_button( NactIActionTab *instance )
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]