aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/ChangeLog10
-rw-r--r--addressbook/gui/component/select-names/e-select-names.c29
-rw-r--r--addressbook/gui/component/select-names/e-select-names.h4
3 files changed, 38 insertions, 5 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index c044f24943..21391c91d5 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,13 @@
+2003-03-18 Not Zed <NotZed@Ximian.com>
+
+ * gui/component/select-names/e-select-names.c (set_book,
+ addressbook_model_set_uri): disconnect/keep track of search result
+ signal id.
+ (e_select_names_init): Keep track of various signals, particularly
+ status signal.
+ (e_select_names_dispose): disconnect from any signals that are
+ still active. Fixes crash for #38202.
+
2003-03-13 Chris Toshok <toshok@ximian.com>
* gui/contact-editor/e-contact-editor.c
diff --git a/addressbook/gui/component/select-names/e-select-names.c b/addressbook/gui/component/select-names/e-select-names.c
index 51af18c78f..9be940ce8f 100644
--- a/addressbook/gui/component/select-names/e-select-names.c
+++ b/addressbook/gui/component/select-names/e-select-names.c
@@ -122,6 +122,11 @@ search_result (EAddressbookModel *model, EBookViewStatus status, ESelectNames *e
static void
set_book(EBook *book, EBookStatus status, ESelectNames *esn)
{
+ if (esn->search_id) {
+ g_signal_handler_disconnect(esn->model, esn->search_id);
+ esn->search_id = 0;
+ }
+
g_object_set(esn->model,
"book", book,
NULL);
@@ -151,9 +156,11 @@ addressbook_model_set_uri(ESelectNames *e_select_names, EAddressbookModel *model
book = e_book_new();
- g_signal_connect (model,
- "search_result", G_CALLBACK (search_result),
- e_select_names);
+ if (e_select_names->search_id)
+ g_signal_handler_disconnect(model, e_select_names->search_id);
+ e_select_names->search_id = g_signal_connect (model,
+ "search_result", G_CALLBACK (search_result),
+ e_select_names);
g_object_ref(e_select_names);
g_object_ref(model);
@@ -520,8 +527,8 @@ e_select_names_init (ESelectNames *e_select_names)
if (e_select_names->status_message && !GTK_IS_LABEL (e_select_names->status_message))
e_select_names->status_message = NULL;
if (e_select_names->status_message) {
- g_signal_connect (e_select_names->model, "status_message",
- G_CALLBACK (status_message), e_select_names);
+ e_select_names->status_id = g_signal_connect (e_select_names->model, "status_message",
+ G_CALLBACK (status_message), e_select_names);
g_object_weak_ref (G_OBJECT (e_select_names->status_message), clear_widget, &e_select_names->status_message);
}
@@ -604,6 +611,18 @@ e_select_names_dispose (GObject *object)
{
ESelectNames *e_select_names = E_SELECT_NAMES(object);
+ printf("eselectnames dispose\n");
+
+ if (e_select_names->status_id) {
+ g_signal_handler_disconnect(e_select_names->model, e_select_names->status_id);
+ e_select_names->status_id = 0;
+ }
+
+ if (e_select_names->search_id) {
+ g_signal_handler_disconnect(e_select_names->model, e_select_names->search_id);
+ e_select_names->search_id = 0;
+ }
+
if (e_select_names->gui) {
g_object_unref(e_select_names->gui);
e_select_names->gui = NULL;
diff --git a/addressbook/gui/component/select-names/e-select-names.h b/addressbook/gui/component/select-names/e-select-names.h
index bbed1d77ee..ccf4eebd5f 100644
--- a/addressbook/gui/component/select-names/e-select-names.h
+++ b/addressbook/gui/component/select-names/e-select-names.h
@@ -73,6 +73,10 @@ struct _ESelectNames
GtkWidget *status_message;
char *def;
ESelectNamesFolder *current_folder;
+
+ /* signal handlers */
+ gulong status_id;
+ gulong search_id;
};
struct _ESelectNamesClass