diff --git a/base/include/refbase.h b/base/include/refbase.h index 4113a63f47726b55d7d7e8beaa126aa34d7dcfd6..4b2b0d03933b972e034349f7fc00dc544adc4e35 100755 --- a/base/include/refbase.h +++ b/base/include/refbase.h @@ -335,6 +335,9 @@ inline sptr &sptr::operator=(const sptr &other) template inline sptr &sptr::operator=(const wptr &other) { + if (refs_ != nullptr) { + refs_->DecStrongRef(this); + } if ((other != nullptr) && other.AttemptIncStrongRef(this)) { refs_ = other.GetRefPtr(); } else {