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.
pull/1043/head
Christopher Lam 5 years ago
parent 36d119d8e8
commit e7076b41ac

@ -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;
}

Loading…
Cancel
Save