aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-attachment-button.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-02-18 02:11:37 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-02-18 02:11:37 +0800
commitdf8b6db32ebe7e4ced4f43c86a0fb859a1defd21 (patch)
treeaaca359e8323befd2de67ac654e67137a32d1803 /widgets/misc/e-attachment-button.c
parentb5a4e10a04b653109991aa30a07f4a14bf1fa787 (diff)
downloadgsoc2013-evolution-df8b6db32ebe7e4ced4f43c86a0fb859a1defd21.tar.gz
gsoc2013-evolution-df8b6db32ebe7e4ced4f43c86a0fb859a1defd21.tar.zst
gsoc2013-evolution-df8b6db32ebe7e4ced4f43c86a0fb859a1defd21.zip
Forgot to disconnect a signal handler in EAttachmentButton.
The "deactivate" handler for EAttachmentButton's popup menu was never disconnected, and I suspect it may be getting invoked after the button has been finalized.
Diffstat (limited to 'widgets/misc/e-attachment-button.c')
-rw-r--r--widgets/misc/e-attachment-button.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/widgets/misc/e-attachment-button.c b/widgets/misc/e-attachment-button.c
index dac9b28c75..d1b02c09f3 100644
--- a/widgets/misc/e-attachment-button.c
+++ b/widgets/misc/e-attachment-button.c
@@ -41,6 +41,7 @@ struct _EAttachmentButtonPrivate {
GtkWidget *expand_button;
GtkWidget *toggle_button;
GtkWidget *cell_view;
+ GtkWidget *popup_menu;
guint expandable : 1;
guint expanded : 1;
@@ -278,17 +279,21 @@ static void
attachment_button_set_view (EAttachmentButton *button,
EAttachmentView *view)
{
- GtkWidget *menu;
+ GtkWidget *popup_menu;
g_return_if_fail (button->priv->view == NULL);
button->priv->view = g_object_ref (view);
- menu = e_attachment_view_get_popup_menu (view);
+ popup_menu = e_attachment_view_get_popup_menu (view);
g_signal_connect_swapped (
- menu, "deactivate",
+ popup_menu, "deactivate",
G_CALLBACK (attachment_button_menu_deactivate_cb), button);
+
+ /* Keep a reference to the popup menu so we can
+ * disconnect the signal handler in dispose(). */
+ button->priv->popup_menu = g_object_ref (popup_menu);
}
static void
@@ -400,6 +405,14 @@ attachment_button_dispose (GObject *object)
priv->cell_view = NULL;
}
+ if (priv->popup_menu != NULL) {
+ g_signal_handlers_disconnect_matched (
+ priv->popup_menu, G_SIGNAL_MATCH_DATA,
+ 0, 0, NULL, NULL, object);
+ g_object_unref (priv->popup_menu);
+ priv->popup_menu = NULL;
+ }
+
/* Chain up to parent's dispose() method. */
G_OBJECT_CLASS (parent_class)->dispose (object);
}