starstutter
01-02-2009, 11:04 PM
Lets say I have 2 textures declared:
LPDIRECT3DTEXTURE9 texObject;
LPDIRECT3DTEXTURE9 texPointer;
Now first off I realize both of these are pointers (despite the names given), but then I create a texture in one of them:
d3ddev->CreateTexture(texObject);
Now, I say:
texPointer = texObject;
I know that texPointer will not equal the actual texture itself (only the pointer to it) but here's my question:
do I now have to call the Release() function on texPointer to avoid a memory leak? Or is this taken care of when I later release texObject. They both point to the same place so I would think that releasing one would cover any memory problems, however I'm not sure and I want to be certain that making it texPointer equal to a LPDIRECT3DTEXTURE9 will not cause a memory leak if not released.
LPDIRECT3DTEXTURE9 texObject;
LPDIRECT3DTEXTURE9 texPointer;
Now first off I realize both of these are pointers (despite the names given), but then I create a texture in one of them:
d3ddev->CreateTexture(texObject);
Now, I say:
texPointer = texObject;
I know that texPointer will not equal the actual texture itself (only the pointer to it) but here's my question:
do I now have to call the Release() function on texPointer to avoid a memory leak? Or is this taken care of when I later release texObject. They both point to the same place so I would think that releasing one would cover any memory problems, however I'm not sure and I want to be certain that making it texPointer equal to a LPDIRECT3DTEXTURE9 will not cause a memory leak if not released.