Try to fix crash at startup.

This commit is contained in:
hiker
2014-11-15 12:05:14 +11:00
parent 2ec5c3765a
commit be461b7a39
3 changed files with 5 additions and 4 deletions

View File

@@ -108,7 +108,7 @@ public:
*/
bool operator== (const Version &other) const
{
int min_n = std::min(m_version.size(), other.m_version.size());
unsigned int min_n = std::min(m_version.size(), other.m_version.size());
for(unsigned int i=0; i<min_n; i++)
if(other.m_version[i]!=m_version[i]) return false;
return true;
@@ -116,7 +116,7 @@ public:
// ------------------------------------------------------------------------
bool operator< (const Version &other) const
{
int min_n = std::min(m_version.size(), other.m_version.size());
unsigned int min_n = std::min(m_version.size(), other.m_version.size());
for(unsigned int i=0; i<min_n; i++)
if(other.m_version[i]>=m_version[i]) return false;
return true;
@@ -289,8 +289,6 @@ void init()
std::vector<std::string> getRestrictions(const std::string &driver_version,
const std::string &card_name)
{
init();
std::vector<std::string> restrictions;
Version version(driver_version, card_name);

View File

@@ -28,6 +28,7 @@
namespace GraphicsRestrictions
{
void init();
std::vector<std::string> getRestrictions(const std::string &driver_version,
const std::string &card_name);
}; // HardwareStats

View File

@@ -320,6 +320,8 @@ void IrrDriver::createListOfVideoModes()
*/
void IrrDriver::initDevice()
{
GraphicsRestrictions::init();
// If --no-graphics option was used, the null device can still be used.
if (!ProfileWorld::isNoGraphics())
{