Sign in to follow this  
fuchiefck

CloneMeshFVF and memory leaks

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this