Recommended Posts

iv made a start on game programming in directX and its going allright everythings working but when i end the game im getting
Direct3D9: (ERROR) :Memory still allocated! Alloc count = 2451
Direct3D9: (ERROR) :Current Process (pid) = 000000a8
Direct3D9: (ERROR) :Memory Address: 023007f4 lAllocID=1 dwSize=00004bc4, ReturnAddr=721899aa (pid=000000a8)
the longer it runs for the more the alloc count is i have released my D3D (LPDIRECT3D9) and my d3dDev (LPDIRECT3DDEVICE9) the only other things related to directX in there are locals for loading a sprite and displaying it and they are done in functions my load and draw sprite are below

Share this post

Link to post

Share on other sites

Calling this method will increase the internal reference count on the IDirect3DSurface9 interface. Failure to call IUnknown::Release when finished using this IDirect3DSurface9 interface results in a memory leak.

D3D functions that return interfaces usually also increase reference counts.

0

Share this post

Link to post

Share on other sites

Share this post

Link to post

Share on other sites

thanks that was a lot quicker then expected i released the back buffer and i made the surface one global so i can release it with my other 2 releases and it works but i still get the error because i didnt release the one for my player sprite BUT when i try and release the player sprite it causes the original surface from the function to give a access violation when i call the clean up i dont see how releaseing the player sprite can cause that but im sure im missing somthing simple again

[Edited by - W4R1SH3R3 on July 13, 2008 9:43:22 AM]

0

Share this post

Link to post

Share on other sites

Run the DirectX control panel (dxcpl.exe) and there is a debugging option called "Break on AllocID". Put in the AllocID and it will break when it creates the object and show you which object your not releasing before exit.

0

Share this post

Link to post

Share on other sites

Ok my access violation error that i said i started getting in my other post some how fixed its self so now im error free and HeadKaze thanks for telling me about that option to in the dxcpl it will come in usfull for the tired coding sessions :P