Sign in to follow this  

menory leaks with d3d

Recommended Posts

hi i am having problems with memory leaks with d3d9 every time i exit my program i get the following junk Direct3D9: (ERROR) : [3] : Address 010FE215 Direct3D9: (ERROR) : [4] : Address 01145EF8 Direct3D9: (ERROR) : [5] : Address 011489FD i have currently disabled all rendering and am only using swapchains atm if someone could find a reason for this in the following code it would be a great help
void DisplayNorm(float &timeDelta)
   D3DXMATRIX matTranslation;


	chain1->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &pBackBuffer);
	Device->SetRenderTarget(0, pBackBuffer);
   Device->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffffffff, 1.0f, 0);
      chain1->Present(NULL, NULL, g_hwnd1, NULL, 0);

Share this post

Link to post
Share on other sites
The first line of the error sequence for the memory that was still allocated contains an "AllocID". Use that, and enter it to the "Break on AllocID" field in the DirectX App in the Control Panel. This will make DX stop when the object that you are not releasing is created -- showing you what it is.

Hope this helps.

Share this post

Link to post
Share on other sites
I just updated my journal with an entry about using smart pointers and Direct3D. Using smart pointers would quite probably solve your problem [wink]

Are you definitely sure that pBackBuffer->Release(); is called every frame? How about all other objects?

You really should be checking the return codes for your functions - you could be missing lots of errors and getting your application into inconsistent states.


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