From e7076b41ac91b505ee69c573919f9464cabea56e Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Thu, 17 Jun 2021 21:05:17 +0800 Subject: [PATCH] GValue: don't unset until the boxed pointer isn't used anymore Because GValue was unset earlier in this function, the default_font_family would point to garbage. We need to unset the GValue after the default_font_family is used to set the GObject. --- gnucash/html/gnc-html-webkit2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnucash/html/gnc-html-webkit2.c b/gnucash/html/gnc-html-webkit2.c index f776b33ce8..a892a4cb90 100644 --- a/gnucash/html/gnc-html-webkit2.c +++ b/gnucash/html/gnc-html-webkit2.c @@ -142,7 +142,6 @@ gnc_html_webkit_webview_new (void) const PangoFontDescription *font = (const PangoFontDescription*)g_value_get_boxed (&val); default_font_family = pango_font_description_get_family (font); - g_value_unset (&val); } /* Set default webkit settings */ webkit_settings = webkit_web_view_get_settings (WEBKIT_WEB_VIEW (view)); @@ -162,6 +161,7 @@ gnc_html_webkit_webview_new (void) g_object_set (G_OBJECT (webkit_settings), "default-font-family", default_font_family, NULL); } + g_value_unset (&val); return view; }