aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-03-16 20:47:20 +0800
committerMilan Crha <mcrha@redhat.com>2012-03-16 20:47:20 +0800
commit60f3e852e7246e3107b80cfa72a76e0c50753ede (patch)
tree091c99289f14a91d80a6b97db27bc5a3789d8fbf
parent608069630f978c2da37bc57ee58342ba9d16f70f (diff)
downloadgsoc2013-evolution-60f3e852e7246e3107b80cfa72a76e0c50753ede.tar.gz
gsoc2013-evolution-60f3e852e7246e3107b80cfa72a76e0c50753ede.tar.zst
gsoc2013-evolution-60f3e852e7246e3107b80cfa72a76e0c50753ede.zip
Bug #665130 - Memory leaks in Preferences and ETable
-rw-r--r--widgets/misc/e-preferences-window.c4
-rw-r--r--widgets/table/e-table.c1
-rw-r--r--widgets/table/gal-a11y-e-table-item.c19
3 files changed, 21 insertions, 3 deletions
diff --git a/widgets/misc/e-preferences-window.c b/widgets/misc/e-preferences-window.c
index 3bce24371e..986d66f206 100644
--- a/widgets/misc/e-preferences-window.c
+++ b/widgets/misc/e-preferences-window.c
@@ -556,6 +556,10 @@ e_preferences_window_setup (EPreferencesWindow *window)
g_return_if_fail (E_IS_PREFERENCES_WINDOW (window));
priv = E_PREFERENCES_WINDOW_GET_PRIVATE (window);
+
+ if (priv->setup)
+ return;
+
notebook = GTK_NOTEBOOK (priv->notebook);
num = gtk_notebook_get_n_pages (notebook);
diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c
index 50751c8889..aab26439af 100644
--- a/widgets/table/e-table.c
+++ b/widgets/table/e-table.c
@@ -1754,7 +1754,6 @@ et_real_construct (ETable *e_table,
e_table->draw_focus = specification->draw_focus;
e_table->cursor_mode = specification->cursor_mode;
e_table->full_header = e_table_spec_to_full_header (specification, ete);
- g_object_ref (e_table->full_header);
col_count = e_table_header_count (e_table->full_header);
for (i = 0; i < col_count; i++) {
diff --git a/widgets/table/gal-a11y-e-table-item.c b/widgets/table/gal-a11y-e-table-item.c
index 2c6de549b9..ea9c12b1d7 100644
--- a/widgets/table/gal-a11y-e-table-item.c
+++ b/widgets/table/gal-a11y-e-table-item.c
@@ -72,6 +72,21 @@ static gboolean gal_a11y_e_table_item_unref_selection (GalA11yETableItem *a11y);
static AtkObject * eti_ref_at (AtkTable *table, gint row, gint column);
static void
+free_columns (ETableCol **columns)
+{
+ gint ii;
+
+ if (!columns)
+ return;
+
+ for (ii = 0; columns[ii]; ii++) {
+ g_object_unref (columns[ii]);
+ }
+
+ g_free (columns);
+}
+
+static void
item_finalized (gpointer user_data,
GObject *gone_item)
{
@@ -219,7 +234,7 @@ eti_dispose (GObject *object)
GalA11yETableItemPrivate *priv = GET_PRIVATE (a11y);
if (priv->columns) {
- g_free (priv->columns);
+ free_columns (priv->columns);
priv->columns = NULL;
}
@@ -934,7 +949,7 @@ eti_header_structure_changed (ETableHeader *eth,
g_free (reorder);
g_free (prev_state);
- g_free (priv->columns);
+ free_columns (priv->columns);
priv->columns = cols;
}