Original Post
I''ve just noticed a memory leak that ocurrs during reset when there is D3DERR_DEVICENOTRESET (e.g., after I alt tab and then maximize the program, which runs in full screen).
This little bit of code tries to reset directx so that it will run after the user has alt-tabbed or done any sort of minimizing/maximizing in fullscreen.
It works fine, but I''ve noticed a memory leak, and I haven''t a clue as to what it''s from.
I know it''s not from any of my vertex buffers or index buffers since I''ve made a call to the class to which the buffers belong which would release the buffers, and also because the reset is successful, and DirectX whines if I don''t release my D3DPOOL_DEFAULT buffers before reset.
Is there any source for this memory leak that anyone may know of?
Here''s a snippet of the code that handles what I''m talking about:
SAFE_RELEASE(g_pBackSurf);
g_BGCube.KillBuffers();
for (int i = 0; i < CUBE_MAX; i++){
g_CubeSet.m_CubeArray.KillBuffers();
}
r = g_pDevice->Reset(&g_SavedPresParams);
KillBuffers() is the method that kills(releases) the buffers of the cubes in the game (the game is Tetris Attack by the way)
Am I forgetting to release anything here?