Skip to content

Commit

Permalink
0.3.2: Merge pull request #5 from CODIANZ/development
Browse files Browse the repository at this point in the history
0.3.2
  • Loading branch information
terukazu-inoue authored Apr 21, 2023
2 parents f322aee + 8a84e39 commit c6bbdd0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 5 additions & 5 deletions include/another-rxcpp/internal/tools/stream_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ template <typename T> class stream_controller {
using serial_type = int32_t;
using unsubscriber_map = std::map<serial_type, internal::fn<void()>>;
using on_finalize_t = internal::fn<void()>;
using on_finalizes_t = std::vector<on_finalize_t>;
using on_finalizes_t = std::shared_ptr<on_finalize_t>;

private:
struct inner {
Expand Down Expand Up @@ -48,7 +48,7 @@ template <typename T> class stream_controller {

void set_on_finalize(on_finalize_t&& f) const noexcept {
std::lock_guard<std::recursive_mutex> lock(inner_->mtx_);
inner_->on_finalizes_.push_back(std::move(f));
inner_->on_finalizes_.reset(new on_finalize_t(std::move(f)));
}

template <typename In> observer<In> new_observer(
Expand Down Expand Up @@ -158,10 +158,10 @@ template <typename T> class stream_controller {
if(inner_->subscriber_.is_subscribed()){
inner_->subscriber_.unsubscribe();
}
for(auto it = inner_->on_finalizes_.begin(); it != inner_->on_finalizes_.end(); it++){
(*it)();
if(inner_->on_finalizes_ && *inner_->on_finalizes_){
(*inner_->on_finalizes_)();
}
inner_->on_finalizes_.clear();
inner_->on_finalizes_.reset();
}

bool is_subscribed() const noexcept {
Expand Down
1 change: 0 additions & 1 deletion include/another-rxcpp/schedulers/async_scheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class async_scheduler_interface : public scheduler_interface {
}

virtual void detach() noexcept override {
future_ = {};
}

virtual void schedule(const function_type& f) noexcept override {
Expand Down

0 comments on commit c6bbdd0

Please sign in to comment.