about drop device problem

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
klikli234
Posts: 97
Joined: Tue Sep 07, 2010 10:52 am

about drop device problem

Post by klikli234 »

first I load map than release map,
than drop device will I get Memory error on drop device.
thanks.
and where is my wrong?

Code: Select all

m_gamemap.loadMap(); //like examples 16
//quit loop
m_gamemap.releaseMap();
m_device->drop(); //here is memory error

Code: Select all

//release map
void CGameMap::releaseMap()
{
	if(m_Mesh)
	{
		m_Mesh->drop();
		m_Mesh = NULL;
	}
	if(m_MapNode)
	{
		m_MapNode->remove();
		m_MapNode = NULL;
	}
	if(m_ShaderNodeParent)
	{
		m_ShaderNodeParent->removeAll();
		m_ShaderNodeParent=NULL;
	}
	if(m_MapMeta)
	{
		m_MapMeta->drop();
		m_MapMeta=NULL;
	}
}
CuteAlien
Admin
Posts: 10039
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Please read through the documentation of the IReferenceCounted interface: http://irrlicht.sourceforge.net/docu/cl ... unted.html

Most likely you dropped an object which was not created with new or a create function.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply