[gnome-commander/gvfs_mount: 1/9] 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/gvfs_mount: 1/9] Allocate and initialize g_variant_builder using g_variant_builder_new
- Date: Tue, 15 Jun 2021 21:51:03 +0000 (UTC)
commit 177d38042a5b504aa0fe3b1bf8fdfb5b393a48af
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]