Commit 0586e3801b5fc4143820c52a05cd831a49e594d6
1 parent
7be0fcf4
Fix not creating a listener when no config is defined
Showing
2 changed files
with
7 additions
and
6 deletions
configfileparser.cpp
| ... | ... | @@ -289,12 +289,6 @@ void ConfigFileParser::loadFile(bool test) |
| 289 | 289 | } |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | - if (tmpSettings->listeners.empty()) | |
| 293 | - { | |
| 294 | - std::shared_ptr<Listener> defaultListener(new Listener()); | |
| 295 | - tmpSettings->listeners.push_back(defaultListener); | |
| 296 | - } | |
| 297 | - | |
| 298 | 292 | tmpSettings->authOptCompatWrap = AuthOptCompatWrap(authOpts); |
| 299 | 293 | |
| 300 | 294 | if (!test) | ... | ... |
mainapp.cpp
| ... | ... | @@ -476,6 +476,13 @@ void MainApp::loadConfig() |
| 476 | 476 | confFileParser->loadFile(false); |
| 477 | 477 | settings = std::move(confFileParser->settings); |
| 478 | 478 | |
| 479 | + if (settings->listeners.empty()) | |
| 480 | + { | |
| 481 | + std::shared_ptr<Listener> defaultListener(new Listener()); | |
| 482 | + defaultListener->isValid(); | |
| 483 | + settings->listeners.push_back(defaultListener); | |
| 484 | + } | |
| 485 | + | |
| 479 | 486 | // 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 |
| 480 | 487 | // loading them to a local var which is never updated. |
| 481 | 488 | if (listeners.empty()) | ... | ... |