diff options
author | Nickolay V. Shmyrev <nshmyrev@yandex.ru> | 2006-09-04 18:36:49 +0800 |
---|---|---|
committer | Sankarasivasubramanian Pasupathilingam <psankar@src.gnome.org> | 2006-09-04 18:36:49 +0800 |
commit | 96be78cafd1c1215b372bec3d771c84fe19e2b3c (patch) | |
tree | 785c986ecf138f4518704daf34410c06dfdde906 /mail/mail-component.c | |
parent | 62349899fa7b12cd7d0730c74c308bd842411a8e (diff) | |
download | gsoc2013-evolution-96be78cafd1c1215b372bec3d771c84fe19e2b3c.tar.gz gsoc2013-evolution-96be78cafd1c1215b372bec3d771c84fe19e2b3c.tar.zst gsoc2013-evolution-96be78cafd1c1215b372bec3d771c84fe19e2b3c.zip |
Fixes a crash on exit-time issue. Resolves #334966
2006-09-04 Nickolay V. Shmyrev <nshmyrev@yandex.ru>
* mail-component.c: (impl_dispose)
(view_changed_timeout_remove) (view_changed_timeout):
Fixes a crash on exit-time issue. Resolves #334966
svn path=/trunk/; revision=32736
Diffstat (limited to 'mail/mail-component.c')
-rw-r--r-- | mail/mail-component.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/mail/mail-component.c b/mail/mail-component.c index 18d05c4cae..c9093b61fe 100644 --- a/mail/mail-component.c +++ b/mail/mail-component.c @@ -91,6 +91,7 @@ #define d(x) static void create_local_item_cb(EUserCreatableItemsHandler *handler, const char *item_type_name, void *data); +static void view_changed_timeout_remove (EComponentView *component_view); #define MAIL_COMPONENT_DEFAULT(mc) if (mc == NULL) mc = mail_component_peek(); @@ -439,6 +440,8 @@ impl_dispose (GObject *object) { MailComponentPrivate *priv = MAIL_COMPONENT (object)->priv; + view_changed_timeout_remove ((EComponentView *)object); + if (priv->activity_handler != NULL) { g_object_unref (priv->activity_handler); priv->activity_handler = NULL; @@ -580,6 +583,25 @@ view_changed(EMFolderView *emfv, EComponentView *component_view) } } +static void +view_changed_timeout_remove (EComponentView *component_view) +{ + gpointer v; + EInfoLabel *el; + EMFolderView *emfv; + + v = g_object_get_data((GObject *)component_view, "view-changed-timeout"); + if (v) { + g_source_remove(GPOINTER_TO_INT(v)); + g_object_set_data((GObject *)component_view, "view-changed-timeout", NULL); + + el = g_object_get_data((GObject *)component_view, "info-label"); + emfv = g_object_get_data((GObject *)el, "folderview"); + g_object_unref(el); + g_object_unref(emfv); + } +} + static int view_changed_timeout(void *d) { @@ -589,7 +611,7 @@ view_changed_timeout(void *d) view_changed(emfv, component_view); - g_object_set_data((GObject *)emfv, "view-changed-timeout", NULL); + g_object_set_data((GObject *)component_view, "view-changed-timeout", NULL); g_object_unref(el); g_object_unref(emfv); @@ -607,7 +629,7 @@ view_changed_cb(EMFolderView *emfv, EComponentView *component_view) we don't need to/want to run it immediately */ /* NB: we should have a 'view' struct/object to manage this crap, but this'll do for now */ - v = g_object_get_data((GObject *)emfv, "view-changed-timeout"); + v = g_object_get_data((GObject *)component_view, "view-changed-timeout"); if (v) { g_source_remove(GPOINTER_TO_INT(v)); } else { @@ -615,7 +637,7 @@ view_changed_cb(EMFolderView *emfv, EComponentView *component_view) g_object_ref(el); } - g_object_set_data((GObject *)emfv, "view-changed-timeout", GINT_TO_POINTER(g_timeout_add(250, view_changed_timeout, component_view))); + g_object_set_data((GObject *)component_view, "view-changed-timeout", GINT_TO_POINTER(g_timeout_add(250, view_changed_timeout, component_view))); } static void |