aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/ChangeLog10
-rw-r--r--addressbook/gui/component/addressbook.c10
-rw-r--r--addressbook/gui/minicard/e-minicard.c4
-rw-r--r--addressbook/gui/widgets/e-minicard.c4
4 files changed, 24 insertions, 4 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 8f37c1388b..c05d832dde 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,13 @@
+2000-05-07 <toshok@the-dot-in.helixcode.com>
+
+ * gui/minicard/e-minicard.c (remodel): make sure to free the
+ return value of e_card_simple_get.
+
+ * gui/component/addressbook.c (teardown_table_view): destroy the
+ ECardSimple here, plug memory leak.
+ (create_table_view): use view->simple so we can destroy the
+ ECardSimple later on.
+
2000-05-07 Chris Toshok <toshok@helixcode.com>
* ename/e-name-western.c (e_name_western_extract_middle): comment
diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c
index 520ffab568..7794bb50b3 100644
--- a/addressbook/gui/component/addressbook.c
+++ b/addressbook/gui/component/addressbook.c
@@ -54,6 +54,7 @@ typedef struct {
GnomeCanvasItem *rect;
GtkWidget *table;
ETableModel *model;
+ ECardSimple *simple;
GtkAllocation last_alloc;
BonoboControl *control;
BonoboPropertyBag *properties;
@@ -654,6 +655,10 @@ teardown_table_view (AddressbookView *view)
gtk_object_unref (GTK_OBJECT (view->model));
view->model = NULL;
}
+ if (view->simple) {
+ gtk_object_destroy (GTK_OBJECT (view->simple));
+ view->simple = NULL;
+ }
}
static void
@@ -662,7 +667,8 @@ create_table_view (AddressbookView *view, char *initial_query)
ECell *cell_left_just;
ETableHeader *e_table_header;
int i;
- ECardSimple *simple = e_card_simple_new(NULL);
+
+ view->simple = e_card_simple_new(NULL);
view->model = e_addressbook_model_new();
@@ -690,7 +696,7 @@ create_table_view (AddressbookView *view, char *initial_query)
for (i = 0; i < E_CARD_SIMPLE_FIELD_LAST - 1; i++){
/* Create the column. */
ETableCol *ecol = e_table_col_new (
- i, e_card_simple_get_name(simple, i+1),
+ i, e_card_simple_get_name(view->simple, i+1),
80, 20, cell_left_just,
g_str_compare, TRUE);
/* Add it to the header. */
diff --git a/addressbook/gui/minicard/e-minicard.c b/addressbook/gui/minicard/e-minicard.c
index 6173ee2c9a..0d60824c81 100644
--- a/addressbook/gui/minicard/e-minicard.c
+++ b/addressbook/gui/minicard/e-minicard.c
@@ -547,9 +547,11 @@ remodel( EMinicard *e_minicard )
e_minicard->fields = NULL;
for(field = E_CARD_SIMPLE_FIELD_FULL_NAME; field != E_CARD_SIMPLE_FIELD_LAST && count < 5; field++) {
- if (e_card_simple_get(e_minicard->simple, field)) {
+ char *value = e_card_simple_get(e_minicard->simple, field);
+ if (value) {
add_field(e_minicard, field);
count++;
+ g_free (value);
}
}
}
diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c
index 6173ee2c9a..0d60824c81 100644
--- a/addressbook/gui/widgets/e-minicard.c
+++ b/addressbook/gui/widgets/e-minicard.c
@@ -547,9 +547,11 @@ remodel( EMinicard *e_minicard )
e_minicard->fields = NULL;
for(field = E_CARD_SIMPLE_FIELD_FULL_NAME; field != E_CARD_SIMPLE_FIELD_LAST && count < 5; field++) {
- if (e_card_simple_get(e_minicard->simple, field)) {
+ char *value = e_card_simple_get(e_minicard->simple, field);
+ if (value) {
add_field(e_minicard, field);
count++;
+ g_free (value);
}
}
}