mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 06:53:43 +00:00
Fix somewhat incorrect upscale texture handling. Replace InstancedResources reset with something that's less likely to be undefined behavior.
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreDefs.h"
|
||||
|
||||
template<class T>
|
||||
class GpComPtr final
|
||||
{
|
||||
public:
|
||||
GpComPtr();
|
||||
GpComPtr(const GpComPtr<T> &other);
|
||||
#if GP_IS_CPP11
|
||||
GpComPtr(GpComPtr<T> &&other);
|
||||
#endif
|
||||
explicit GpComPtr(T *ptr);
|
||||
~GpComPtr();
|
||||
|
||||
@@ -41,6 +46,23 @@ inline GpComPtr<T>::GpComPtr(const GpComPtr<T> &other)
|
||||
m_ptr->AddRef();
|
||||
}
|
||||
|
||||
#if GP_IS_CPP11
|
||||
template<class T>
|
||||
inline GpComPtr<T>::GpComPtr(GpComPtr<T> &&other)
|
||||
: m_ptr(other.m_ptr)
|
||||
{
|
||||
if (m_ptr)
|
||||
m_ptr->AddRef();
|
||||
|
||||
if (other.m_ptr)
|
||||
{
|
||||
other.m_ptr->Release();
|
||||
other.m_ptr = nullptr;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
template<class T>
|
||||
inline GpComPtr<T>::GpComPtr(T *ptr)
|
||||
: m_ptr(ptr)
|
||||
|
Reference in New Issue
Block a user