mirror of
https://github.com/boostorg/coroutine2.git
synced 2025-05-09 23:24:01 +00:00
Fixing a resource leak in move assignment
Signed-off-by: Saliya Hamparawa <hamparawa@gmail.com>
This commit is contained in:
parent
40cbfe5c01
commit
7a702c4e86
@ -56,8 +56,7 @@ public:
|
|||||||
|
|
||||||
pull_coroutine & operator=( pull_coroutine && other) noexcept {
|
pull_coroutine & operator=( pull_coroutine && other) noexcept {
|
||||||
if ( this == & other) return * this;
|
if ( this == & other) return * this;
|
||||||
cb_ = other.cb_;
|
std::swap(cb_, other.cb_);
|
||||||
other.cb_ = nullptr;
|
|
||||||
return * this;
|
return * this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,8 +54,7 @@ public:
|
|||||||
|
|
||||||
push_coroutine & operator=( push_coroutine && other) noexcept {
|
push_coroutine & operator=( push_coroutine && other) noexcept {
|
||||||
if ( this == & other) return * this;
|
if ( this == & other) return * this;
|
||||||
cb_ = other.cb_;
|
std::swap(cb_, other.cb_);
|
||||||
other.cb_ = nullptr;
|
|
||||||
return * this;
|
return * this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user