[gnome-commander] Allocate and initialize g_variant_builder using g_variant_builder_new
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] Allocate and initialize g_variant_builder using g_variant_builder_new
- Date: Sun, 20 Jun 2021 21:58:00 +0000 (UTC)
commit 8bf6c44a5bc82ac41c62bbda2c8e8661836f7326
Author: Uwe Scholz <u scholz83 gmx de>
Date: Sun Jun 6 16:28:21 2021 +0200
Allocate and initialize g_variant_builder using g_variant_builder_new
For some reason, there happened a crash when adding a device in the options dialog and using
g_variant_builder_init. That's why I changed it to g_variant_builder_new.
src/gnome-cmd-data.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index 51407cccb..2d9c57542 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -1731,7 +1731,7 @@ void GnomeCmdData::save_devices()
{
if (!gVariantBuilder)
{
- g_variant_builder_init (gVariantBuilder, G_VARIANT_TYPE_ARRAY);
+ gVariantBuilder = g_variant_builder_new (G_VARIANT_TYPE_ARRAY);
}
gchar *icon_path = g_strdup (gnome_cmd_con_device_get_icon_path (device));
@@ -1751,6 +1751,7 @@ void GnomeCmdData::save_devices()
{
devicesToStore = g_variant_builder_end (gVariantBuilder);
g_settings_set_value(options.gcmd_settings->general, GCMD_SETTINGS_DEVICES, devicesToStore);
+ g_variant_builder_unref(gVariantBuilder);
return;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]