CloneMeshFVF and memory leaks

Started by
0 comments, last by fuchiefck 18 years, 10 months ago
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
-fuchiefck----------------------------------------------------------"Inside the world that you as a programmer or developer create, you are God" - Zerbst & Duvel
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
-fuchiefck----------------------------------------------------------"Inside the world that you as a programmer or developer create, you are God" - Zerbst & Duvel

This topic is closed to new replies.

Advertisement