Fix bug with dead FileItems in fileitems_map.

This commit is contained in:
David Capello 2011-07-06 22:03:58 -03:00
parent 57dd972ce5
commit 8cc1e0e7b7

View File

@ -436,7 +436,7 @@ IFileItem* FileItem::getParent() const
const FileItemList& FileItem::getChildren()
{
/* is the file-item a folder? */
// Is the file-item a folder?
if (IS_FOLDER(this) &&
// if the children list is empty, or the file-system version
// change (it's like to say: the current this->children list
@ -554,6 +554,8 @@ const FileItemList& FileItem::getChildren()
child = static_cast<FileItem*>(*it);
if (child->removed) {
it = this->children.erase(it);
fileitems_map->erase(fileitems_map->find(child->keyname));
delete child;
}
else