diff options
Diffstat (limited to 'common/comptr.h')
-rw-r--r-- | common/comptr.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/common/comptr.h b/common/comptr.h index 5984ebd9..3dc574e8 100644 --- a/common/comptr.h +++ b/common/comptr.h @@ -46,10 +46,8 @@ public: { if(likely(&rhs != this)) { - if(mPtr) - mPtr->Release(); - mPtr = rhs.mPtr; - rhs.mPtr = nullptr; + if(mPtr) mPtr->Release(); + mPtr = std::exchange(rhs.mPtr, nullptr); } return *this; } |