mirror of
https://github.com/moparisthebest/minetest
synced 2024-11-16 06:15:06 -05:00
fix mesh leak in camera class
This commit is contained in:
parent
7c0e707cf1
commit
e1146396bc
@ -69,7 +69,8 @@ Camera::Camera(scene::ISceneManager* smgr, MapDrawControl& draw_control,
|
|||||||
m_view_bobbing_speed(0),
|
m_view_bobbing_speed(0),
|
||||||
|
|
||||||
m_digging_anim(0),
|
m_digging_anim(0),
|
||||||
m_digging_button(-1)
|
m_digging_button(-1),
|
||||||
|
m_dummymesh(createCubeMesh(v3f(1,1,1)))
|
||||||
{
|
{
|
||||||
//dstream<<__FUNCTION_NAME<<std::endl;
|
//dstream<<__FUNCTION_NAME<<std::endl;
|
||||||
|
|
||||||
@ -84,13 +85,14 @@ Camera::Camera(scene::ISceneManager* smgr, MapDrawControl& draw_control,
|
|||||||
// all other 3D scene nodes and before the GUI.
|
// all other 3D scene nodes and before the GUI.
|
||||||
m_wieldmgr = smgr->createNewSceneManager();
|
m_wieldmgr = smgr->createNewSceneManager();
|
||||||
m_wieldmgr->addCameraSceneNode();
|
m_wieldmgr->addCameraSceneNode();
|
||||||
m_wieldnode = m_wieldmgr->addMeshSceneNode(createCubeMesh(v3f(1,1,1)), NULL); // need a dummy mesh
|
m_wieldnode = m_wieldmgr->addMeshSceneNode(m_dummymesh, NULL); // need a dummy mesh
|
||||||
}
|
}
|
||||||
|
|
||||||
Camera::~Camera()
|
Camera::~Camera()
|
||||||
{
|
{
|
||||||
m_wieldnode->setMesh(NULL);
|
|
||||||
m_wieldmgr->drop();
|
m_wieldmgr->drop();
|
||||||
|
|
||||||
|
delete m_dummymesh;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Camera::successfullyCreated(std::wstring& error_message)
|
bool Camera::successfullyCreated(std::wstring& error_message)
|
||||||
|
@ -173,6 +173,9 @@ private:
|
|||||||
// If 0, left-click digging animation
|
// If 0, left-click digging animation
|
||||||
// If 1, right-click digging animation
|
// If 1, right-click digging animation
|
||||||
s32 m_digging_button;
|
s32 m_digging_button;
|
||||||
|
|
||||||
|
//dummymesh for camera
|
||||||
|
irr::scene::IAnimatedMesh* m_dummymesh;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user