From e04ac5728204339ec85fee64a48b88e112beeccc Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Fri, 06 Oct 2017 04:07:37 -0400 Subject: src/web-settings.c: Initialize GValue structs before g_value_init() Fixes: (marquee:xxxxx): GLib-GObject-WARNING **: [...]: cannot initialize GValue with type 'gboolean', the value has already been initialized as '(null)' (marquee:xxxxx): GLib-GObject-CRITICAL **: g_value_set_boolean: assertion 'G_VALUE_HOLDS_BOOLEAN (value)' failed --- (limited to 'src') diff --git a/src/web-settings.c b/src/web-settings.c index fc8a24d..e0d8ebd 100644 --- a/src/web-settings.c +++ b/src/web-settings.c @@ -155,7 +155,7 @@ static GHashTable *mappings_table = NULL; static void bool_cb(const gchar *name, const gboolean value, WebKitSettings *wk_settings) { - GValue g_value; + GValue g_value = G_VALUE_INIT; g_value_init(&g_value, G_TYPE_BOOLEAN); g_value_set_boolean(&g_value, value); @@ -166,7 +166,7 @@ bool_cb(const gchar *name, const gboolean value, WebKitSettings *wk_settings) static void bool_n_cb(const gchar *name, const gboolean value, WebKitSettings *wk_settings) { - GValue g_value; + GValue g_value = G_VALUE_INIT; g_value_init(&g_value, G_TYPE_BOOLEAN); g_value_set_boolean(&g_value, value); @@ -177,7 +177,7 @@ bool_n_cb(const gchar *name, const gboolean value, WebKitSettings *wk_settings) static void int_cb(const gchar *name, const gint value, WebKitSettings *wk_settings) { - GValue g_value; + GValue g_value = G_VALUE_INIT; g_value_init(&g_value, G_TYPE_INT); g_value_set_int(&g_value, value); @@ -188,7 +188,7 @@ int_cb(const gchar *name, const gint value, WebKitSettings *wk_settings) static void str_cb(const gchar *name, const gchar *value, WebKitSettings *wk_settings) { - GValue g_value; + GValue g_value = G_VALUE_INIT; g_value_init(&g_value, G_TYPE_STRING); g_value_set_static_string(&g_value, value); -- cgit v0.9.1