aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2001-10-27 02:29:39 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-10-27 02:29:39 +0800
commit33b867e6ccedfbc0fe36f416f49882d314d9e486 (patch)
tree4e9f5ea0a6fd279dc39bcc20e9c57365c77bfdb0 /addressbook/gui
parent9cf4da473a8f51c9dccce3ca94945730e4445c5a (diff)
downloadgsoc2013-evolution-33b867e6ccedfbc0fe36f416f49882d314d9e486.tar
gsoc2013-evolution-33b867e6ccedfbc0fe36f416f49882d314d9e486.tar.gz
gsoc2013-evolution-33b867e6ccedfbc0fe36f416f49882d314d9e486.tar.bz2
gsoc2013-evolution-33b867e6ccedfbc0fe36f416f49882d314d9e486.tar.lz
gsoc2013-evolution-33b867e6ccedfbc0fe36f416f49882d314d9e486.tar.xz
gsoc2013-evolution-33b867e6ccedfbc0fe36f416f49882d314d9e486.tar.zst
gsoc2013-evolution-33b867e6ccedfbc0fe36f416f49882d314d9e486.zip
Remove bad dialog ref-counting crap.
2001-10-26 Jon Trowbridge <trow@ximian.com> * gui/contact-editor/e-contact-save-as.c (file_exists): Remove bad dialog ref-counting crap. * gui/contact-editor/e-contact-editor.c (save_card): Ref our EContactEditor, since we are holding a pointer to it in EditorCloseStruct. (card_modified_cb): Unref our EContactEditor when we free our EditorCloseStruct. (card_added_cb): Unref our EContactEditor when we free our EditorCloseStruct. svn path=/trunk/; revision=14157
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c12
-rw-r--r--addressbook/gui/contact-editor/e-contact-save-as.c3
2 files changed, 8 insertions, 7 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index 72d49b5908..30835ce19b 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -824,8 +824,6 @@ card_added_cb (EBook *book, EBookStatus status, const char *id, EditorCloseStruc
EContactEditor *ce = ecs->ce;
gboolean should_close = ecs->should_close;
- g_free (ecs);
-
e_card_set_id (ce->card, id);
gtk_signal_emit (GTK_OBJECT (ce), contact_editor_signals[CARD_ADDED],
@@ -842,6 +840,9 @@ card_added_cb (EBook *book, EBookStatus status, const char *id, EditorCloseStruc
command_state_changed (ce);
}
}
+
+ gtk_object_unref (GTK_OBJECT (ce));
+ g_free (ecs);
}
static void
@@ -850,8 +851,6 @@ card_modified_cb (EBook *book, EBookStatus status, EditorCloseStruct *ecs)
EContactEditor *ce = ecs->ce;
gboolean should_close = ecs->should_close;
- g_free (ecs);
-
gtk_signal_emit (GTK_OBJECT (ce), contact_editor_signals[CARD_MODIFIED],
status, ce->card);
@@ -864,6 +863,9 @@ card_modified_cb (EBook *book, EBookStatus status, EditorCloseStruct *ecs)
command_state_changed (ce);
}
}
+
+ gtk_object_unref (GTK_OBJECT (ce));
+ g_free (ecs);
}
/* Emits the signal to request saving a card */
@@ -877,6 +879,8 @@ save_card (EContactEditor *ce, gboolean should_close)
EditorCloseStruct *ecs = g_new(EditorCloseStruct, 1);
ecs->ce = ce;
+ gtk_object_ref (GTK_OBJECT (ecs->ce));
+
ecs->should_close = should_close;
if (ce->is_new_card)
diff --git a/addressbook/gui/contact-editor/e-contact-save-as.c b/addressbook/gui/contact-editor/e-contact-save-as.c
index ec174615e9..2573eab1b3 100644
--- a/addressbook/gui/contact-editor/e-contact-save-as.c
+++ b/addressbook/gui/contact-editor/e-contact-save-as.c
@@ -196,7 +196,6 @@ file_exists(GtkFileSelection *filesel, const char *filename)
gui = glade_xml_new (EVOLUTION_GLADEDIR "/file-exists.glade", NULL);
dialog = GNOME_DIALOG(glade_xml_get_widget(gui, "dialog-exists"));
- gtk_widget_ref(GTK_WIDGET(dialog));
label = glade_xml_get_widget (gui, "label-exists");
if (GTK_IS_LABEL (label)) {
@@ -210,8 +209,6 @@ file_exists(GtkFileSelection *filesel, const char *filename)
gtk_widget_show (GTK_WIDGET (dialog));
result = gnome_dialog_run_and_close(dialog);
- gtk_widget_unref(GTK_WIDGET(dialog));
- gtk_widget_destroy(GTK_WIDGET(dialog));
g_free(gui);
return result;