Fixed ResourceRef not removing references
Former-commit-id: 4f3578aeb60ea6cba6f18ba7d5f0f0e9a06a05c9
This commit is contained in:
parent
5464b3e184
commit
9c88cbfa84
|
|
@ -98,7 +98,7 @@ NzResourceRef<T>& NzResourceRef<T>::operator=(T* resource)
|
||||||
{
|
{
|
||||||
if (m_resource != resource)
|
if (m_resource != resource)
|
||||||
{
|
{
|
||||||
Release();
|
Reset();
|
||||||
|
|
||||||
if (resource)
|
if (resource)
|
||||||
{
|
{
|
||||||
|
|
@ -115,7 +115,7 @@ NzResourceRef<T>& NzResourceRef<T>::operator=(const NzResourceRef& ref)
|
||||||
{
|
{
|
||||||
if (m_resource != ref.m_resource)
|
if (m_resource != ref.m_resource)
|
||||||
{
|
{
|
||||||
Release();
|
Reset();
|
||||||
|
|
||||||
if (ref)
|
if (ref)
|
||||||
{
|
{
|
||||||
|
|
@ -130,7 +130,7 @@ NzResourceRef<T>& NzResourceRef<T>::operator=(const NzResourceRef& ref)
|
||||||
template<typename T>
|
template<typename T>
|
||||||
NzResourceRef<T>& NzResourceRef<T>::operator=(NzResourceRef&& ref)
|
NzResourceRef<T>& NzResourceRef<T>::operator=(NzResourceRef&& ref)
|
||||||
{
|
{
|
||||||
Release();
|
Reset();
|
||||||
|
|
||||||
std::swap(m_resource, ref.m_resource);
|
std::swap(m_resource, ref.m_resource);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue