Commit 8c3034c9 authored by Dominik Charousset's avatar Dominik Charousset

Fix invocation order

parent 51fdf3d4
...@@ -181,12 +181,12 @@ private: ...@@ -181,12 +181,12 @@ private:
void deliver(uint32_t n) { void deliver(uint32_t n) {
auto first = buf_ + rd_pos_; auto first = buf_ + rd_pos_;
auto last = first + n; auto last = first + n;
sink_.on_next(span<const T>{first, n});
std::destroy(first, last);
CAF_ASSERT(rd_pos_ + n <= wr_pos_); CAF_ASSERT(rd_pos_ + n <= wr_pos_);
rd_pos_ += n; rd_pos_ += n;
CAF_ASSERT(credit_ >= n); CAF_ASSERT(credit_ >= n);
credit_ -= n; credit_ -= n;
sink_.on_next(span<const T>{first, n});
std::destroy(first, last);
} }
void shift_elements() { void shift_elements() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment