• Advertisement
Sign in to follow this  

CloneMeshFVF and memory leaks

This topic is 4619 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all... I have a line in my code, that creates a copy of pOldMesh into pNewMesh:
pOldMesh->CloneMeshFVF(pOldMesh->GetOptions(), pOldMesh->GetFVF(), pDevice, &pNewMesh);
And its causing weird memory leaks (3 blocks)... do I need to use a tempMesh in between? do I need to AddRef()/Release() anything? when I comment this line out my program is mem leak free... Or could this be caused by other lines of the code? thanks very much in advance.... this is driving me nuts..! -fuchiefck

Share this post


Link to post
Share on other sites
Advertisement
Hi again... that was quick... I solved the problem..!

I forgot to mention before, that pNewMesh has a mesh loaded into it at the start... so I just added another line before the CloneMeshFVF...

pNewMesh->Release();
pOldMesh->CloneMeshFVF(pOldMesh->GetOptions(), pOldMesh->GetFVF(), pDevice, &pNewMesh);

and now its fine... hmmm...

I think this is something I like about GameDev... when u are stuck at a problem for so long... you spend about 5 mins away from your program and post a question on GameDev, and when you go back to your program again... you seem to think about the problem from another point of view... and then vua la... you will probably come up with a new solution that solves your problem... GameDev is really helpful..!!

-fuchiefck

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement