fixed bug in Engine::Object destructor
git-svn-id: svn://anubis/anaglym/trunk@133 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
parent
2616100ded
commit
e0d20f1a2b
13
Engine.cc
13
Engine.cc
@ -665,12 +665,15 @@ Engine::Object::Object(const Engine::Object & orig)
|
||||
Engine::Object::~Object()
|
||||
{
|
||||
delete m_ode_object;
|
||||
(*m_display_list_refcnt)--;
|
||||
if (*m_display_list_refcnt < 1)
|
||||
if (m_display_list_refcnt != NULL)
|
||||
{
|
||||
/* we hold the last reference to the OpenGL display list */
|
||||
delete m_display_list_refcnt;
|
||||
glDeleteLists(m_display_list, 1);
|
||||
(*m_display_list_refcnt)--;
|
||||
if (*m_display_list_refcnt < 1)
|
||||
{
|
||||
/* we hold the last reference to the OpenGL display list */
|
||||
delete m_display_list_refcnt;
|
||||
glDeleteLists(m_display_list, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
12
ag.cc
12
ag.cc
@ -40,6 +40,18 @@ namespace ag
|
||||
{ "isKeyDown", isKeyDown },
|
||||
{ "registerEventHandler", registerEventHandler },
|
||||
{ "clearEventHandler", clearEventHandler },
|
||||
|
||||
{ "createBox", createBox},
|
||||
{ "createStaticBox", createStaticBox},
|
||||
{ "createSphere", createSphere},
|
||||
{ "createStaticSphere", createStaticSphere},
|
||||
{ "createPlane", createPlane},
|
||||
{ "createStaticPlane", createStaticPlane},
|
||||
{ "createCylinder", createCylinder},
|
||||
{ "createStaticCylinder", createStaticCylinder},
|
||||
{ "createCCylinder", createCCylinder},
|
||||
{ "createStaticCCylinder", createStaticCCylinder},
|
||||
|
||||
{ NULL, NULL }
|
||||
};
|
||||
luaL_register(L, "ag", functions);
|
||||
|
Loading…
x
Reference in New Issue
Block a user