mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-21 15:43:45 +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
a6710285db
commit
3658f1587d
1 changed files with 4 additions and 5 deletions
|
|
@ -142,7 +142,7 @@ VolumetricFog::VolumetricFog()
|
|||
|
||||
VolumetricFog::~VolumetricFog()
|
||||
{
|
||||
if (isClientObject())
|
||||
if (!isClientObject())
|
||||
return;
|
||||
|
||||
for (S32 i = 0; i < det_size.size(); i++)
|
||||
|
|
@ -152,12 +152,11 @@ VolumetricFog::~VolumetricFog()
|
|||
if (det_size[i].piArray != NULL)
|
||||
delete(det_size[i].piArray);
|
||||
if (det_size[i].verts != NULL)
|
||||
delete(det_size[i].verts);
|
||||
delete [] (det_size[i].verts);
|
||||
}
|
||||
det_size.clear();
|
||||
|
||||
if (z_buf.isValid())
|
||||
SAFE_DELETE(z_buf);
|
||||
z_buf = NULL;
|
||||
|
||||
if (!mTexture.isNull())
|
||||
mTexture.free();
|
||||
|
|
@ -365,7 +364,7 @@ bool VolumetricFog::LoadShape()
|
|||
if (det_size[i].piArray != NULL)
|
||||
delete(det_size[i].piArray);
|
||||
if (det_size[i].verts != NULL)
|
||||
delete(det_size[i].verts);
|
||||
delete [] (det_size[i].verts);
|
||||
}
|
||||
det_size.clear();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue