mirror of
https://github.com/oatpp/oatpp.git
synced 2024-11-21 03:14:51 +08:00
Merge pull request #373 from oatpp/fix_wrong_loop_call_on_conditional_nullptr_issue372
Fix wrong calling of conditional loop if condition is null (Closes #372)
This commit is contained in:
commit
6b4413552a
@ -103,10 +103,14 @@ void Server::run(std::function<bool()> conditional) {
|
||||
m_threaded = false;
|
||||
setStatus(STATUS_CREATED, STATUS_STARTING);
|
||||
|
||||
m_condition = std::move(conditional);
|
||||
|
||||
ul.unlock(); // early unlock
|
||||
conditionalMainLoop();
|
||||
if (conditional) {
|
||||
m_condition = std::move(conditional);
|
||||
ul.unlock(); // early unlock
|
||||
conditionalMainLoop();
|
||||
} else {
|
||||
ul.unlock();
|
||||
mainLoop(this);
|
||||
}
|
||||
}
|
||||
|
||||
void Server::run(bool startAsNewThread) {
|
||||
|
Loading…
Reference in New Issue
Block a user