Skip to content

Commit

Permalink
Bug fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnbrq committed Oct 19, 2023
1 parent 92e3b34 commit f703974
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions include/cxxdes/core/impl/coroutine_data.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,9 @@ struct coroutine_data: memory::reference_counted_base<coroutine_data> {
void destroy() {
complete_ = true;

while (!call_stack_.empty()) {
call_stack_.back().destroy();
call_stack_.pop_back();
}
// only destroy the first one, which will automatically destroy the rest
call_stack_.front().destroy();
call_stack_.clear();
}

virtual ~coroutine_data() = default;
Expand Down

0 comments on commit f703974

Please sign in to comment.