Fixed ResourceRef not removing references

Former-commit-id: 4f3578aeb60ea6cba6f18ba7d5f0f0e9a06a05c9
This commit is contained in:
Lynix 2013-03-24 00:59:16 +01:00
parent 5464b3e184
commit 9c88cbfa84
1 changed files with 3 additions and 3 deletions

View File

@ -98,7 +98,7 @@ NzResourceRef<T>& NzResourceRef<T>::operator=(T* resource)
{
if (m_resource != resource)
{
Release();
Reset();
if (resource)
{
@ -115,7 +115,7 @@ NzResourceRef<T>& NzResourceRef<T>::operator=(const NzResourceRef& ref)
{
if (m_resource != ref.m_resource)
{
Release();
Reset();
if (ref)
{
@ -130,7 +130,7 @@ NzResourceRef<T>& NzResourceRef<T>::operator=(const NzResourceRef& ref)
template<typename T>
NzResourceRef<T>& NzResourceRef<T>::operator=(NzResourceRef&& ref)
{
Release();
Reset();
std::swap(m_resource, ref.m_resource);