Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Bug #815: memory leak in SetShadowCast
Product:
TV3D SDK 6.5
Language:
C++
Current State:
New
Resolution:
Unconfirmed
Created On:
February 5th, 2008
Last Modified:
February 5th, 2008
Reported By:
QPSbv
Hi all!
In my application a certain mesh is updated every second. The length and shape can vary every time, so I have to rebuild the mesh each time. This results in an incrementing memory usage.

So here is what I do in short

m_pScene->DestroyMesh (pMesh);
pMesh = m_pScene->CreateMeshBuilder();
pMesh->SetMeshFormat(cTV_MESHFORMAT_SIMPLE);
pMesh->SetLightingMode(cTV_LIGHTING_NORMAL);
pMesh->SetBlendingMode (cTV_BLEND_ALPHA);
pMesh->SetCullMode (cTV_BACK_CULL);
pMesh->SetGeometry(&Vertices0, m_Vertex, &*vecIndex.begin(), nFaces, 0, 0);
pMesh->SetMaterial(m_MaterialId);
pMesh->Enable(true);
pMesh->SetShadowCast (true, true);

When I disable the last line of code (SetShadowCast) the memory usage remains the same.

Comments:

Posted by GD on February 18th, 2008 at 5:19 PM
after line:
m_pScene->DestroyMesh (pMesh);

do:
DeleteTVObject(pMesh); //function included in "HelperFunctions.h"
Posted by QPSbv on March 10th, 2008 at 1:10 PM
Hi GD,
calling "DeleteTVObject(pMesh)" after the DestroyMesh doesn't solve my problem. Anyone else?
Posted by bwilliams on June 5th, 2014 at 6:53 AM
I can confirm that there is a memory leak in SetShadowCast.

My code I loop through is something like this:

While (True)
Call myMesh.SetShadowCast(False, False)
Call myMesh.SetGeometry(v(0), n, v2(0), m)
Call myMesh.SetShadowCast(True, False) 'problem line
Wend

Without the call to SetShadowCast there is no continual memory increase.

I'm using VB6 so I was not able to test DeleteTVObject(pMesh).

Please could I have some advice on how to deal with this issue.
Thanks