Skip to main content
GameDev.net gamedev.net
🔒 Locked

Memory still allocated!

Started by Nullio Mar 22, 2003 at 3:50 PM 1 replies 150+ views
Original Post
Nullio
Nullio
I have 4 directdraw objects in my project:
LPDIRECTDRAW7 m_lpMainDD;    //Main DirectDraw object
LPDIRECTDRAWSURFACE7 m_lpDDSurfacePrimary;     //Back Surface
LPDIRECTDRAWSURFACE7 m_lpDDBackSurface;	  //Primary Surface
LPDIRECTDRAWCLIPPER m_lpDDClipper;	//Clipping object
 
and my shutdown code looks like this:
	if (m_lpDDBackSurface) {
		m_lpDDBackSurface->Release();
		m_lpDDBackSurface=NULL;
	}

	if (m_lpDDSurfacePrimary) {
		m_lpDDSurfacePrimary->Release();
		m_lpDDSurfacePrimary=NULL;
	}

	if (m_lpDDClipper) {
		m_lpDDClipper->Release();
		m_lpDDClipper=NULL;
	}

	if (m_lpMainDD) {
		m_lpMainDD->Release();
		m_lpMainDD=NULL;
	}
 
But I get a debug output when my program ends saying: "Memory still allocated! Alloc count = 28" then a big list of memory addresses which don''t help 1 bit. Am I doing something wrong with my shutdown code? and is there an easy way to see what surfaces and object are not released (like getting an accual variable name would be nice)
Irrelevant
Irrelevant
I think it''s the clipper... once you attach it to a surface, it becomes referenced again, and thus requires an additional Release() call. Did you do that? if not, do it after you attach the clipper.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.