From e54f81855dc49e302e42e17538256fe738dba73f Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Sun, 28 Aug 2016 20:10:17 -0300 Subject: Settings update: Fix cloud_git_url I was freeing data segment, sigh. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- core/subsurface-qt/SettingsObjectWrapper.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/core/subsurface-qt/SettingsObjectWrapper.cpp b/core/subsurface-qt/SettingsObjectWrapper.cpp index edb5ad804..55670eb22 100644 --- a/core/subsurface-qt/SettingsObjectWrapper.cpp +++ b/core/subsurface-qt/SettingsObjectWrapper.cpp @@ -1089,9 +1089,15 @@ void CloudStorageSettings::setBaseUrl(const QString& value) { if (value == prefs.cloud_base_url) return; - qDebug() << prefs.cloud_base_url << prefs.cloud_git_url; - free((void*)prefs.cloud_base_url); - free((void*)prefs.cloud_git_url); + + // dont free data segment. + if (prefs.cloud_base_url != default_prefs.cloud_base_url) { + free((void*)prefs.cloud_base_url); + free((void*)prefs.cloud_git_url); + } + QSettings s; + s.beginGroup(group); + s.setValue("cloud_base_url", value); prefs.cloud_base_url = copy_string(qPrintable(value)); prefs.cloud_git_url = copy_string(qPrintable(QString(prefs.cloud_base_url) + "/git")); } -- cgit v1.2.3-70-g09d2