Fix: addFileArchive now grab()'s the archive when you pass one in by pointer.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5210 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2015-12-12 20:31:43 +00:00
parent f6623a32bf
commit cfa84f1683
2 changed files with 13 additions and 5 deletions

View File

@ -1,6 +1,7 @@
--------------------------
Changes in 1.9 (not yet released)
- Fix: addFileArchive now grab()'s the archive when you pass one in by pointer.
- Fix: Prevent division by 0 in CGUIScrollBar::setPos
- Fix: Add missing serialization to CSceneNodeAnimatorCameraFPS and CSceneNodeAnimatorCameraMaya
- Fix: File-open dialog now restores the original locale after modifying it internally

View File

@ -428,15 +428,22 @@ bool CFileSystem::addFileArchive(IReadFile* file, bool ignoreCase,
//! Adds an archive to the file system.
bool CFileSystem::addFileArchive(IFileArchive* archive)
{
for (u32 i=0; i < FileArchives.size(); ++i)
if ( archive )
{
if (archive == FileArchives[i])
for (u32 i=0; i < FileArchives.size(); ++i)
{
return false;
if (archive == FileArchives[i])
{
return false;
}
}
FileArchives.push_back(archive);
archive->grab();
return true;
}
FileArchives.push_back(archive);
return true;
return false;
}