Do I have a memory leak? I am creating a game engine and I have some code that seems right to me, but my code analysis tool (CPKKak) says that I have a memory leak, it is probably a bad positive.
I have (this is a bare bone use case) In my net class, I have some direct x points when I load mesh, then I send a shared IPTR to load a function in my Graphics Manager class. In that function I Now at the end of this function when CPP checks say pMaterials and pTextures their memory leaks it's my understanding that pMaterials and pTextures There are references to pointers within my fish and in the memory, I point to it because the points in the Aries point to that instant memory, and as long as I destroy the Aries object some time later (and delete the call [ ] MpMaterials; [] mpTexture S; in the destruction of the arsenal) I have not leaked the right memory? I wrote a check on memory leaks in CPK and I agree that this is a false positive and I will fix it. Do not hesitate to report it to the CPK issue issue tracker. class aries {D3DMATERIAL9 * mpMaterials; LPDIRECT3DTEXTURE9 * mpTextures; D3DMATERIAL9 * & amp; GetMaterials () {Return mpMaterials; } LPEDETET3AQWARE 9 * & amp; GetTexures () {Return mpTextures; }};
Zero Renderer :: Loadmesh (Shared _Peter & Lt; Mesh & gt; Mimesh) {// Other Code D3DMTRI 9 * & amp; ; PMaterials = myMesh-> GetMaterials (); LPDIRECT3DTEXTURE9 * & amp; PTextures = myMesh- & gt; GetTextures (); // other code // and then they are PMaterials = new D3DMATERIAL9 [matCount]; PTextures = new LPDIRECT3DTEXTURE9 [texCount]; // And then I do some stuff with those items}
Comments
Post a Comment