Skip to content

Commit

Permalink
bugfix: correctly handle duplicated calls to setup()
Browse files Browse the repository at this point in the history
  • Loading branch information
cmnrd committed Aug 5, 2022
1 parent 77bb7da commit 6d642cf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/reactor-cpp/impl/action_impl.hh
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ template <class Dur> void Action<void>::schedule(Dur delay) {
}

template <class T> void Action<T>::setup() noexcept {
const auto& node = events_.extract(events_.begin());
if (!node.empty()) {
if (value_ptr_ == nullptr) {
const auto& node = events_.extract(events_.begin());
reactor_assert(!node.empty());
value_ptr_ = std::move(node.mapped());
}
}
Expand Down

0 comments on commit 6d642cf

Please sign in to comment.