Bugfix: don't clear cursors in linux-device after the display has been closed already. Fixes crashes on application shutdown with more than one device.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3418 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2010-09-19 21:11:39 +00:00
parent e12988e77a
commit 4a5a8ef7f4
2 changed files with 8 additions and 1 deletions

View File

@ -136,6 +136,7 @@ CIrrDeviceLinux::~CIrrDeviceLinux()
XFree(StdHints); XFree(StdHints);
// Disable cursor (it is drop'ed in stub) // Disable cursor (it is drop'ed in stub)
CursorControl->setVisible(false); CursorControl->setVisible(false);
static_cast<CCursorControl*>(CursorControl)->clearCursors();
if (display) if (display)
{ {
#ifdef _IRR_COMPILE_WITH_OPENGL_ #ifdef _IRR_COMPILE_WITH_OPENGL_
@ -2095,6 +2096,12 @@ CIrrDeviceLinux::CCursorControl::CCursorControl(CIrrDeviceLinux* dev, bool null)
} }
CIrrDeviceLinux::CCursorControl::~CCursorControl() CIrrDeviceLinux::CCursorControl::~CCursorControl()
{
// Do not clearCursors here as the display is already closed
// TODO (cutealien): droping cursorcontrol earlier might work, not sure about reason why that's done in stub currently.
}
void CIrrDeviceLinux::CCursorControl::clearCursors()
{ {
for ( u32 i=0; i < Cursors.size(); ++i ) for ( u32 i=0; i < Cursors.size(); ++i )
{ {
@ -2105,7 +2112,6 @@ CIrrDeviceLinux::CCursorControl::~CCursorControl()
} }
} }
#ifdef _IRR_COMPILE_WITH_X11_ #ifdef _IRR_COMPILE_WITH_X11_
void CIrrDeviceLinux::CCursorControl::initCursors() void CIrrDeviceLinux::CCursorControl::initCursors()
{ {

View File

@ -294,6 +294,7 @@ namespace irr
#ifdef _IRR_COMPILE_WITH_X11_ #ifdef _IRR_COMPILE_WITH_X11_
void update(); void update();
void clearCursors();
#endif #endif
private: private: