From bf6549488fb23431fb81700deec2d38ba34c6ec2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 26 Oct 2018 22:13:18 +0200 Subject: [PATCH] Backported fix for Projucer crash when saving global search-path --- ...or-crash-when-saving-global-search-p.patch | 53 +++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 54 insertions(+) create mode 100644 debian/patches/0010-Backported-fix-for-crash-when-saving-global-search-p.patch diff --git a/debian/patches/0010-Backported-fix-for-crash-when-saving-global-search-p.patch b/debian/patches/0010-Backported-fix-for-crash-when-saving-global-search-p.patch new file mode 100644 index 00000000..9105ecb2 --- /dev/null +++ b/debian/patches/0010-Backported-fix-for-crash-when-saving-global-search-p.patch @@ -0,0 +1,53 @@ +From: =?utf-8?q?IOhannes_m_zm=C3=B6lnig?= +Date: Fri, 26 Oct 2018 22:12:13 +0200 +Subject: Backported fix for crash when saving global-search-path from cmdline + +--- + extras/Projucer/Source/Application/jucer_CommandLine.cpp | 8 +++++--- + extras/Projucer/Source/Settings/jucer_StoredSettings.cpp | 3 +++ + 2 files changed, 8 insertions(+), 3 deletions(-) + +diff --git a/extras/Projucer/Source/Application/jucer_CommandLine.cpp b/extras/Projucer/Source/Application/jucer_CommandLine.cpp +index 4dfe6cf..48c7631 100644 +--- a/extras/Projucer/Source/Application/jucer_CommandLine.cpp ++++ b/extras/Projucer/Source/Application/jucer_CommandLine.cpp +@@ -733,6 +733,8 @@ namespace + + auto settingsFile = userAppData.getChildFile ("Projucer").getChildFile ("Projucer.settings"); + std::unique_ptr xml (XmlDocument::parse (settingsFile)); ++ if (xml == nullptr) ++ ConsoleApplication::fail ("Settings file not valid!"); + auto settingsTree = ValueTree::fromXml (*xml); + + if (! settingsTree.isValid()) +@@ -742,13 +744,13 @@ namespace + if (isThisOS (args[1])) + { + childToSet = settingsTree.getChildWithProperty (Ids::name, "PROJECT_DEFAULT_SETTINGS") +- .getChildWithName ("PROJECT_DEFAULT_SETTINGS"); ++ .getOrCreateChildWithName ("PROJECT_DEFAULT_SETTINGS", nullptr); + } + else + { + childToSet = settingsTree.getChildWithProperty (Ids::name, "FALLBACK_PATHS") +- .getChildWithName ("FALLBACK_PATHS") +- .getChildWithName (args[1] + String ("Fallback")); ++ .getOrCreateChildWithName ("FALLBACK_PATHS", nullptr) ++ .getOrCreateChildWithName (args[1].text + "Fallback", nullptr); + } + + if (! childToSet.isValid()) +diff --git a/extras/Projucer/Source/Settings/jucer_StoredSettings.cpp b/extras/Projucer/Source/Settings/jucer_StoredSettings.cpp +index 5138b18..6d8b25a 100644 +--- a/extras/Projucer/Source/Settings/jucer_StoredSettings.cpp ++++ b/extras/Projucer/Source/Settings/jucer_StoredSettings.cpp +@@ -47,6 +47,9 @@ StoredSettings::StoredSettings() + { + updateOldProjectSettingsFiles(); + reload(); ++ changed (true); ++ flush(); ++ + checkJUCEPaths(); + + projectDefaults.addListener (this); diff --git a/debian/patches/series b/debian/patches/series index 7e16e095..94152030 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -7,3 +7,4 @@ debian_no-usagedata.patch debian_system_modules.patch debian_python3.patch debian_unittests_globalpaths.patch +0010-Backported-fix-for-crash-when-saving-global-search-p.patch -- 2.30.2