mirror of https://github.com/AxioDL/boo.git
Ensure boo IObj instances are heap-allocated
This commit is contained in:
parent
403249582a
commit
49d76b84be
|
@ -10,8 +10,9 @@ namespace boo
|
||||||
class IObj
|
class IObj
|
||||||
{
|
{
|
||||||
std::atomic_int m_refCount = {0};
|
std::atomic_int m_refCount = {0};
|
||||||
public:
|
protected:
|
||||||
virtual ~IObj() = default;
|
virtual ~IObj() = default;
|
||||||
|
public:
|
||||||
virtual std::unique_lock<std::recursive_mutex> destructorLock() { return {}; }
|
virtual std::unique_lock<std::recursive_mutex> destructorLock() { return {}; }
|
||||||
void increment() { m_refCount++; }
|
void increment() { m_refCount++; }
|
||||||
void decrement()
|
void decrement()
|
||||||
|
|
|
@ -1231,6 +1231,8 @@ struct MetalCommandQueue : IGraphicsCommandQueue
|
||||||
if (!m_running)
|
if (!m_running)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@autoreleasepool
|
||||||
|
{
|
||||||
/* Update dynamic data here */
|
/* Update dynamic data here */
|
||||||
MetalDataFactoryImpl* gfxF = static_cast<MetalDataFactoryImpl*>(m_parent->getDataFactory());
|
MetalDataFactoryImpl* gfxF = static_cast<MetalDataFactoryImpl*>(m_parent->getDataFactory());
|
||||||
std::unique_lock<std::recursive_mutex> datalk(gfxF->m_dataMutex);
|
std::unique_lock<std::recursive_mutex> datalk(gfxF->m_dataMutex);
|
||||||
|
@ -1257,8 +1259,6 @@ struct MetalCommandQueue : IGraphicsCommandQueue
|
||||||
}
|
}
|
||||||
datalk.unlock();
|
datalk.unlock();
|
||||||
|
|
||||||
@autoreleasepool
|
|
||||||
{
|
|
||||||
[m_enc endEncoding];
|
[m_enc endEncoding];
|
||||||
m_enc = nullptr;
|
m_enc = nullptr;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue