Skip to content

Commit

Permalink
0.3.6: Merge pull request #9 from CODIANZ/development
Browse files Browse the repository at this point in the history
fix: rare double free crash when running in parallel
  • Loading branch information
terukazu-inoue authored May 12, 2023
2 parents bbb506a + 3347118 commit d8ad993
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/another-rxcpp/internal/tools/stream_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ template <typename T> class stream_controller {
serial_type serial_;
unsubscriber_map unsubscribers_;
on_finalizes_t on_finalizes_;
inner(const subscriber_type& sbsc) noexcept : subscriber_(sbsc), serial_(0) {}
inner(subscriber_type sbsc) noexcept : subscriber_(sbsc), serial_(0) {}
};

mutable std::shared_ptr<inner> inner_;
Expand All @@ -36,7 +36,7 @@ template <typename T> class stream_controller {
stream_controller() = delete;

public:
stream_controller(const subscriber_type& subscriber) noexcept {
stream_controller(subscriber_type subscriber) noexcept {
inner_ = std::make_shared<inner>(subscriber);
subscriber.set_on_unsubscribe([inner = inner_]{
stream_controller(inner).finalize();
Expand Down

0 comments on commit d8ad993

Please sign in to comment.