From 94ec01deda562c323ead315c4ea48043db68b8d0 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 19 Jun 2009 16:58:10 -0400 Subject: Remove a weak pointer when disposing EAttachmentHandler. --- widgets/misc/e-attachment-handler.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/widgets/misc/e-attachment-handler.c b/widgets/misc/e-attachment-handler.c index 0a6ed0505d..303fc33cc2 100644 --- a/widgets/misc/e-attachment-handler.c +++ b/widgets/misc/e-attachment-handler.c @@ -90,6 +90,23 @@ attachment_handler_constructed (GObject *object) * something here in the future. */ } +static void +attachment_handler_dispose (GObject *object) +{ + EAttachmentHandlerPrivate *priv; + + priv = E_ATTACHMENT_HANDLER_GET_PRIVATE (object); + + if (priv->view != NULL) { + g_object_remove_weak_pointer ( + G_OBJECT (priv->view), &priv->view); + priv->view = NULL; + } + + /* Chain up to parent's dispose() method. */ + G_OBJECT_CLASS (parent_class)->dispose (object); +} + static void attachment_handler_class_init (EAttachmentHandlerClass *class) { @@ -102,6 +119,7 @@ attachment_handler_class_init (EAttachmentHandlerClass *class) object_class->set_property = attachment_handler_set_property; object_class->get_property = attachment_handler_get_property; object_class->constructed = attachment_handler_constructed; + object_class->dispose = attachment_handler_dispose; g_object_class_install_property ( object_class, -- cgit v1.2.3