From 0586e3801b5fc4143820c52a05cd831a49e594d6 Mon Sep 17 00:00:00 2001 From: Wiebe Cazemier Date: Sun, 7 Mar 2021 19:59:51 +0100 Subject: [PATCH] Fix not creating a listener when no config is defined --- configfileparser.cpp | 6 ------ mainapp.cpp | 7 +++++++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/configfileparser.cpp b/configfileparser.cpp index 39bc47c..dbb9c7d 100644 --- a/configfileparser.cpp +++ b/configfileparser.cpp @@ -289,12 +289,6 @@ void ConfigFileParser::loadFile(bool test) } } - if (tmpSettings->listeners.empty()) - { - std::shared_ptr defaultListener(new Listener()); - tmpSettings->listeners.push_back(defaultListener); - } - tmpSettings->authOptCompatWrap = AuthOptCompatWrap(authOpts); if (!test) diff --git a/mainapp.cpp b/mainapp.cpp index 5161096..31de8ee 100644 --- a/mainapp.cpp +++ b/mainapp.cpp @@ -476,6 +476,13 @@ void MainApp::loadConfig() confFileParser->loadFile(false); settings = std::move(confFileParser->settings); + if (settings->listeners.empty()) + { + std::shared_ptr defaultListener(new Listener()); + defaultListener->isValid(); + settings->listeners.push_back(defaultListener); + } + // For now, it's too much work to be able to reload new listeners, with all the shared resource stuff going on. So, I'm // loading them to a local var which is never updated. if (listeners.empty()) -- libgit2 0.21.4