summaryrefslogtreecommitdiff
path: root/Rx/v2/src/rxcpp/operators
diff options
context:
space:
mode:
authorKirk Shoop <kirk.shoop@microsoft.com>2017-04-10 22:33:25 -0700
committerGitHub <noreply@github.com>2017-04-10 22:33:25 -0700
commitb41b15f1daf97519433742ff86adad9d0ae8acdd (patch)
treec757bdadd68ab444a556aa6e6a7476a516af4a65 /Rx/v2/src/rxcpp/operators
parent201dd99b6494564c9e8990d0a5c32b23431128d4 (diff)
downloadRxCpp-b41b15f1daf97519433742ff86adad9d0ae8acdd.tar.gz
fix async lifetime in window_toggle (#372)
Diffstat (limited to 'Rx/v2/src/rxcpp/operators')
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-window_toggle.hpp4
1 files changed, 3 insertions, 1 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))));
}