Commit a334195e authored by Dominik Charousset's avatar Dominik Charousset

Fix crash on MSVC plus coding style nitpick

parent 5d47387c
...@@ -44,8 +44,7 @@ public: ...@@ -44,8 +44,7 @@ public:
void dispose() override { void dispose() override {
if (state_) { if (state_) {
decltype(state_) state; auto state = std::move(state_);
state.swap(state_);
state->dispose(); state->dispose();
} }
} }
......
...@@ -89,8 +89,8 @@ public: ...@@ -89,8 +89,8 @@ public:
if (!running && buf.empty()) { if (!running && buf.empty()) {
disposed = true; disposed = true;
if (out) { if (out) {
out.on_error(reason); auto out_hdl = std::move(out);
out = nullptr; out_hdl.on_error(reason);
} }
when_disposed = nullptr; when_disposed = nullptr;
when_consumed_some = nullptr; when_consumed_some = nullptr;
...@@ -164,8 +164,7 @@ public: ...@@ -164,8 +164,7 @@ public:
void dispose() override { void dispose() override {
if (state_) { if (state_) {
decltype(state_) state; auto state = std::move(state_);
state.swap(state_);
state->dispose(); state->dispose();
} }
} }
......
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