mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 08:34:40 +00:00
Fixes a memory leak in the VolumetricFog object and corrects an array alloc mismatch. Once objects were being deleted on the client, the SAFE_DELETE(z_buf) needed to be removed from the destructor. This was causing a runtime crash (release only) because z_buf was still registered with the GFX device.
This commit is contained in:
parent
bb7440ee5a
commit
84c74ce326
1 changed files with 4 additions and 5 deletions
|
|
@ -142,7 +142,7 @@ VolumetricFog::VolumetricFog()
|
||||||
|
|
||||||
VolumetricFog::~VolumetricFog()
|
VolumetricFog::~VolumetricFog()
|
||||||
{
|
{
|
||||||
if (isClientObject())
|
if (!isClientObject())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (S32 i = 0; i < det_size.size(); i++)
|
for (S32 i = 0; i < det_size.size(); i++)
|
||||||
|
|
@ -152,12 +152,11 @@ VolumetricFog::~VolumetricFog()
|
||||||
if (det_size[i].piArray != NULL)
|
if (det_size[i].piArray != NULL)
|
||||||
delete(det_size[i].piArray);
|
delete(det_size[i].piArray);
|
||||||
if (det_size[i].verts != NULL)
|
if (det_size[i].verts != NULL)
|
||||||
delete(det_size[i].verts);
|
delete [] (det_size[i].verts);
|
||||||
}
|
}
|
||||||
det_size.clear();
|
det_size.clear();
|
||||||
|
|
||||||
if (z_buf.isValid())
|
z_buf = NULL;
|
||||||
SAFE_DELETE(z_buf);
|
|
||||||
|
|
||||||
if (!mTexture.isNull())
|
if (!mTexture.isNull())
|
||||||
mTexture.free();
|
mTexture.free();
|
||||||
|
|
@ -365,7 +364,7 @@ bool VolumetricFog::LoadShape()
|
||||||
if (det_size[i].piArray != NULL)
|
if (det_size[i].piArray != NULL)
|
||||||
delete(det_size[i].piArray);
|
delete(det_size[i].piArray);
|
||||||
if (det_size[i].verts != NULL)
|
if (det_size[i].verts != NULL)
|
||||||
delete(det_size[i].verts);
|
delete [] (det_size[i].verts);
|
||||||
}
|
}
|
||||||
det_size.clear();
|
det_size.clear();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue