diff options
-rw-r--r-- | Rx/v2/src/rxcpp/operators/rx-window_toggle.hpp | 4 | ||||
-rw-r--r-- | Rx/v2/test/operators/window_toggle.cpp | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/Rx/v2/src/rxcpp/operators/rx-window_toggle.hpp b/Rx/v2/src/rxcpp/operators/rx-window_toggle.hpp index 1460feb..c17d4bc 100644 --- a/Rx/v2/src/rxcpp/operators/rx-window_toggle.hpp +++ b/Rx/v2/src/rxcpp/operators/rx-window_toggle.hpp @@ -120,6 +120,8 @@ struct window_toggle localState->dest.remove(innerscope); }); + localState->dest.add(localState->cs); + auto source = on_exception( [&](){return localState->coordinator.in(localState->openings);}, localState->dest); @@ -252,7 +254,7 @@ struct window_toggle static subscriber<T, observer_type> make(dest_type d, window_toggle_values v) { auto cs = composite_subscription(); - auto coordinator = v.coordination.create_coordinator(); + auto coordinator = v.coordination.create_coordinator(d.get_subscription()); return make_subscriber<T>(cs, observer_type(this_type(cs, std::move(d), std::move(v), std::move(coordinator)))); } diff --git a/Rx/v2/test/operators/window_toggle.cpp b/Rx/v2/test/operators/window_toggle.cpp index fc9088b..b85c1ba 100644 --- a/Rx/v2/test/operators/window_toggle.cpp +++ b/Rx/v2/test/operators/window_toggle.cpp @@ -35,7 +35,7 @@ SCENARIO("window toggle, basic", "[window_toggle][operators]"){ WHEN("ints are split into windows"){ using namespace std::chrono; - + int wi = 0; auto res = w.start( @@ -310,7 +310,7 @@ SCENARIO("window toggle, disposed", "[window_toggle][operators]"){ THEN("there was one subscription and one unsubscription to the observable"){ auto required = rxu::to_vector({ - o_on.subscribe(200, 590) + o_on.subscribe(200, 420) }); auto actual = xs.subscriptions(); REQUIRE(required == actual); |