From 63c34c461549a1b07aafd191ba9d5f129a896527 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Sun, 18 May 2003 00:48:03 +0000 Subject: (e_storage_set_view_set_show_checkboxes): Reallocate the "expansions" member of ETreeState as well, to avoid a memory error. [#43119] svn path=/trunk/; revision=21232 --- shell/ChangeLog | 6 ++++++ shell/e-storage-set-view.c | 9 +++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/shell/ChangeLog b/shell/ChangeLog index 3025670980..0c7fbc87c6 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,9 @@ +2003-05-17 Ettore Perazzoli + + * e-storage-set-view.c (e_storage_set_view_set_show_checkboxes): + Reallocate the "expansions" member of ETreeState as well, to avoid + a memory error. [#43119] + 2003-05-15 Ettore Perazzoli * e-shell.c (parse_default_uri): Protect against the component diff --git a/shell/e-storage-set-view.c b/shell/e-storage-set-view.c index 735da0ab21..5ec5a9d46b 100644 --- a/shell/e-storage-set-view.c +++ b/shell/e-storage-set-view.c @@ -2316,12 +2316,17 @@ e_storage_set_view_set_show_checkboxes (EStorageSetView *storage_set_view, priv->show_checkboxes = show; state = e_tree_get_state_object (E_TREE (storage_set_view)); - g_free (state->columns); state->col_count = show ? 2 : 1; - state->columns = g_new(int, state->col_count); + state->columns = g_renew (int, state->columns, state->col_count); state->columns [state->col_count - 1] = 0; if (show) state->columns [0] = 1; + + state->expansions = g_renew (double, state->expansions, state->col_count); + state->expansions [0] = 1.0; + if (show) + state->expansions [1] = 1.0; + e_tree_set_state_object (E_TREE (storage_set_view), state); priv->has_checkbox_func = has_checkbox_func; -- cgit v1.2.3