Fixed OnResourceDestroy callback not called by the destructor
Former-commit-id: 8b961101f88343ddd3bb382d2c333052efb03164
This commit is contained in:
@@ -41,6 +41,11 @@ m_startOffset(indexBuffer.m_startOffset)
|
||||
{
|
||||
}
|
||||
|
||||
NzIndexBuffer::~NzIndexBuffer()
|
||||
{
|
||||
NotifyDestroy();
|
||||
}
|
||||
|
||||
unsigned int NzIndexBuffer::ComputeCacheMissCount() const
|
||||
{
|
||||
NzIndexMapper mapper(this);
|
||||
|
||||
@@ -182,6 +182,8 @@ void NzSkeletalMesh::Destroy()
|
||||
{
|
||||
if (m_impl)
|
||||
{
|
||||
NotifyDestroy();
|
||||
|
||||
delete m_impl;
|
||||
m_impl = nullptr;
|
||||
}
|
||||
|
||||
@@ -40,14 +40,16 @@ bool NzStaticMesh::Create(NzVertexBuffer* vertexBuffer)
|
||||
|
||||
void NzStaticMesh::Destroy()
|
||||
{
|
||||
if (m_indexBuffer)
|
||||
{
|
||||
m_indexBuffer->RemoveResourceListener(this);
|
||||
m_indexBuffer = nullptr;
|
||||
}
|
||||
|
||||
if (m_vertexBuffer)
|
||||
{
|
||||
NotifyDestroy();
|
||||
|
||||
if (m_indexBuffer)
|
||||
{
|
||||
m_indexBuffer->RemoveResourceListener(this);
|
||||
m_indexBuffer = nullptr;
|
||||
}
|
||||
|
||||
m_vertexBuffer->RemoveResourceListener(this);
|
||||
m_vertexBuffer = nullptr;
|
||||
}
|
||||
|
||||
@@ -36,6 +36,11 @@ m_vertexCount(vertexBuffer.m_vertexCount)
|
||||
{
|
||||
}
|
||||
|
||||
NzVertexBuffer::~NzVertexBuffer()
|
||||
{
|
||||
NotifyDestroy();
|
||||
}
|
||||
|
||||
bool NzVertexBuffer::Fill(const void* data, unsigned int startVertex, unsigned int length, bool forceDiscard)
|
||||
{
|
||||
unsigned int stride = m_vertexDeclaration->GetStride();
|
||||
|
||||
@@ -53,6 +53,11 @@ m_stride(declaration.m_stride)
|
||||
std::memcpy(m_attributes, declaration.m_attributes, sizeof(Attribute)*(nzAttributeUsage_Max+1));
|
||||
}
|
||||
|
||||
NzVertexDeclaration::~NzVertexDeclaration()
|
||||
{
|
||||
NotifyDestroy();
|
||||
}
|
||||
|
||||
void NzVertexDeclaration::DisableAttribute(nzAttributeUsage usage)
|
||||
{
|
||||
#ifdef NAZARA_DEBUG
|
||||
|
||||
Reference in New Issue
Block a user