From b1ae9e5c83bf58aad30e2ca9f11364f77bfdd6cc Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 11 Aug 2012 17:56:49 -0400 Subject: prefer-plain: Unref objects in dispose(), not finalize(). --- .../prefer-plain/e-mail-display-popup-prefer-plain.c | 19 ++++++++++++++++++- modules/prefer-plain/e-mail-parser-prefer-plain.c | 8 ++++---- 2 files changed, 22 insertions(+), 5 deletions(-) (limited to 'modules') diff --git a/modules/prefer-plain/e-mail-display-popup-prefer-plain.c b/modules/prefer-plain/e-mail-display-popup-prefer-plain.c index e84fbfafe1..889885cecc 100644 --- a/modules/prefer-plain/e-mail-display-popup-prefer-plain.c +++ b/modules/prefer-plain/e-mail-display-popup-prefer-plain.c @@ -355,6 +355,23 @@ e_mail_display_popup_prefer_plain_type_register (GTypeModule *type_module) e_mail_display_popup_prefer_plain_register_type (type_module); } +static void +e_mail_display_popup_prefer_plain_dispose (GObject *object) +{ + EMailDisplayPopupPreferPlain *extension; + + extension = E_MAIL_DISPLAY_POPUP_PREFER_PLAIN (object); + + if (extension->action_group != NULL) { + g_object_unref (extension->action_group); + extension->action_group = NULL; + } + + /* Chain up to parent's dispose() method. */ + G_OBJECT_CLASS (e_mail_display_popup_prefer_plain_parent_class)-> + dispose (object); +} + static void e_mail_display_popup_prefer_plain_finalize (GObject *object) { @@ -364,7 +381,6 @@ e_mail_display_popup_prefer_plain_finalize (GObject *object) g_free (extension->text_html_id); g_free (extension->text_plain_id); - g_object_unref (extension->action_group); /* Chain up to parent's finalize() method. */ G_OBJECT_CLASS (e_mail_display_popup_prefer_plain_parent_class)-> @@ -381,6 +397,7 @@ e_mail_display_popup_prefer_plain_class_init (EMailDisplayPopupPreferPlainClass extension_class->extensible_type = E_TYPE_MAIL_DISPLAY; object_class = G_OBJECT_CLASS (class); + object_class->dispose = e_mail_display_popup_prefer_plain_dispose; object_class->finalize = e_mail_display_popup_prefer_plain_finalize; } diff --git a/modules/prefer-plain/e-mail-parser-prefer-plain.c b/modules/prefer-plain/e-mail-parser-prefer-plain.c index 01c3365939..714e4e462e 100644 --- a/modules/prefer-plain/e-mail-parser-prefer-plain.c +++ b/modules/prefer-plain/e-mail-parser-prefer-plain.c @@ -411,7 +411,7 @@ e_mail_parser_prefer_plain_set_property (GObject *object, } static void -e_mail_parser_prefer_plain_finalize (GObject *object) +e_mail_parser_prefer_plain_dispose (GObject *object) { EMailParserPreferPlain *parser; @@ -419,9 +419,9 @@ e_mail_parser_prefer_plain_finalize (GObject *object) g_clear_object (&parser->settings); - /* Chain up to parent's finalize() method. */ + /* Chain up to parent's dispose() method. */ G_OBJECT_CLASS (e_mail_parser_prefer_plain_parent_class)-> - finalize (object); + dispose (object); } static void @@ -434,7 +434,7 @@ e_mail_parser_prefer_plain_class_init (EMailParserPreferPlainClass *class) object_class->constructed = e_mail_parser_prefer_plain_constructed; object_class->get_property = e_mail_parser_prefer_plain_get_property; object_class->set_property = e_mail_parser_prefer_plain_set_property; - object_class->finalize = e_mail_parser_prefer_plain_finalize; + object_class->dispose = e_mail_parser_prefer_plain_dispose; extension_class = E_EXTENSION_CLASS (class); extension_class->extensible_type = E_TYPE_MAIL_PARSER_EXTENSION_REGISTRY; -- cgit