Skip to content

Commit 1d17d9c

Browse files
committed
fix segfault
1 parent 58fed2b commit 1d17d9c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

include/reactor-cpp/scheduler.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public:
120120
auto insert_event_at(const Tag& tag) -> const ActionListPtr&;
121121

122122
// should only be called while holding the scheduler mutex
123-
auto extract_next_event() -> ActionListPtr&&;
123+
auto extract_next_event() -> ActionListPtr;
124124

125125
// should only be called while holding the scheduler mutex
126126
void return_action_list(ActionListPtr&& action_list);

lib/scheduler.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ auto EventQueue::next_tag() const -> Tag {
160160
return event_queue_.begin()->first;
161161
}
162162

163-
auto EventQueue::extract_next_event() -> ActionListPtr&& {
163+
auto EventQueue::extract_next_event() -> ActionListPtr {
164164
reactor_assert(!event_queue_.empty());
165165
return std::move(event_queue_.extract(event_queue_.begin()).mapped());
166166
}
@@ -347,7 +347,7 @@ void Scheduler::next() { // NOLINT
347347
if (!event_queue_.empty() && t_next == event_queue_.next_tag()) {
348348
log_.debug() << "Schedule the last round of reactions including all "
349349
"termination reactions";
350-
triggered_actions_ = std::move(event_queue_.extract_next_event());
350+
triggered_actions_ = event_queue_.extract_next_event();
351351
log_.debug() << "advance logical time to tag " << t_next;
352352
logical_time_.advance_to(t_next);
353353
} else {
@@ -388,7 +388,7 @@ void Scheduler::next() { // NOLINT
388388
// We do not need to lock mutex_event_queue_ here, as the lock on
389389
// scheduling_mutex_ already ensures that no one can write to the event
390390
// queue.
391-
triggered_actions_ = std::move(event_queue_.extract_next_event());
391+
triggered_actions_ = event_queue_.extract_next_event();
392392

393393
// advance logical time
394394
log_.debug() << "advance logical time to tag " << t_next;

0 commit comments

Comments
 (0)