Fixed rare bug in which stk aborts (because it receives a WM_QUIT message)

immediately after start (after closing the null device and opening the actual
screen).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5734 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk
2010-08-10 01:15:53 +00:00
parent ab92817eb6
commit 426cedcacb

View File

@@ -106,7 +106,16 @@ void IrrDriver::initDevice()
}
//std::cout << "^^^^^^^^ Closing m_device ^^^^^^^^\n";
m_device->closeDevice();
// In some circumstances it would happen that a WM_QUIT message
// (apparently sent for this NULL device) is later received by
// the actual window, causing it to immediately quit.
// Following advise on the irrlicht forums I added the following
// two calles - the first one didn't make a difference (but
// certainly can't hurt), but the second one apparenlty solved
// the problem for now.
m_device->clearSystemMessages();
m_device->run();
firstTime = false;
} // end if firstTime