Fix some weird crashes on windows

This commit is contained in:
David Sansome 2010-06-07 14:51:47 +00:00
parent 729e6783a9
commit afca8d2900
3 changed files with 29 additions and 1 deletions

View File

@ -84,6 +84,8 @@ void PresetLoader::rescan()
while ( ( dir_entry = readdir ( _dir ) ) != NULL )
{
if (dir_entry->d_name == 0)
continue;
std::ostringstream out;
// Convert char * to friendly string

View File

@ -219,7 +219,7 @@ void TextureManager::loadTextureDir()
// Allocate a new a stream given the current directory name
if ((m_dir = opendir(dirname.c_str())) == NULL)
{
std::cout<<"No Textures Loaded from "<<dirname<<std::endl;
//std::cout<<"No Textures Loaded from "<<dirname<<std::endl;
return; // no files loaded. m_entries is empty
}

View File

@ -0,0 +1,26 @@
Index: Renderer/TextureManager.cpp
===================================================================
--- Renderer/TextureManager.cpp (revision 1065)
+++ Renderer/TextureManager.cpp (working copy)
@@ -219,7 +219,7 @@
// Allocate a new a stream given the current directory name
if ((m_dir = opendir(dirname.c_str())) == NULL)
{
- std::cout<<"No Textures Loaded from "<<dirname<<std::endl;
+ //std::cout<<"No Textures Loaded from "<<dirname<<std::endl;
return; // no files loaded. m_entries is empty
}
Index: PresetLoader.cpp
===================================================================
--- PresetLoader.cpp (revision 1065)
+++ PresetLoader.cpp (working copy)
@@ -84,6 +84,8 @@
while ( ( dir_entry = readdir ( _dir ) ) != NULL )
{
+ if (dir_entry->d_name == 0)
+ continue;
std::ostringstream out;
// Convert char * to friendly string