Browse Source

Fix lines iterator not closing opened files

Bart van Strien 14 years ago
parent
commit
9ed5906416
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/modules/filesystem/physfs/Filesystem.cpp

+ 5 - 1
src/modules/filesystem/physfs/Filesystem.cpp

@@ -524,6 +524,11 @@ namespace physfs
 			// Set the beginning of the next line.
 			// Set the beginning of the next line.
 			if(!file->eof())
 			if(!file->eof())
 				file->seek(newline+1);
 				file->seek(newline+1);
+			else if(close)
+			{
+				file->close();
+				file->release();
+			}
 
 
 			return 1;
 			return 1;
 		}
 		}
@@ -534,7 +539,6 @@ namespace physfs
 			file->release();
 			file->release();
 		}
 		}
 
 
-		// else: (newline <= 0)
 		return 0;
 		return 0;
 	}
 	}