Fixing a resource leak in move copy ctor

This commit is contained in:
Oliver Kowalke 2017-12-20 07:38:55 +01:00
parent 826f732188
commit 50f8ae30d1
2 changed files with 12 additions and 12 deletions

View File

@ -67,8 +67,8 @@ pull_coroutine< T >::~pull_coroutine() {
template< typename T >
pull_coroutine< T >::pull_coroutine( pull_coroutine && other) noexcept :
cb_{ other.cb_ } {
other.cb_ = nullptr;
cb_{ nullptr } {
std::swap( cb_, other.cb_);
}
template< typename T >
@ -136,8 +136,8 @@ pull_coroutine< T & >::~pull_coroutine() {
template< typename T >
pull_coroutine< T & >::pull_coroutine( pull_coroutine && other) noexcept :
cb_{ other.cb_ } {
other.cb_ = nullptr;
cb_{ nullptr } {
std::swap( cb_, other.cb_);
}
template< typename T >
@ -197,8 +197,8 @@ pull_coroutine< void >::~pull_coroutine() {
inline
pull_coroutine< void >::pull_coroutine( pull_coroutine && other) noexcept :
cb_{ other.cb_ } {
other.cb_ = nullptr;
cb_{ nullptr } {
std::swap( cb_, other.cb_);
}
inline

View File

@ -56,8 +56,8 @@ push_coroutine< T >::~push_coroutine() {
template< typename T >
push_coroutine< T >::push_coroutine( push_coroutine && other) noexcept :
cb_{ other.cb_ } {
other.cb_ = nullptr;
cb_{ nullptr } {
std::swap( cb_, other.cb_);
}
template< typename T >
@ -116,8 +116,8 @@ push_coroutine< T & >::~push_coroutine() {
template< typename T >
push_coroutine< T & >::push_coroutine( push_coroutine && other) noexcept :
cb_{ other.cb_ } {
other.cb_ = nullptr;
cb_{ nullptr } {
std::swap( cb_, other.cb_);
}
template< typename T >
@ -167,8 +167,8 @@ push_coroutine< void >::~push_coroutine() {
inline
push_coroutine< void >::push_coroutine( push_coroutine && other) noexcept :
cb_{ other.cb_ } {
other.cb_ = nullptr;
cb_{ nullptr } {
std::swap( cb_, other.cb_);
}
inline