mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-11 05:26:24 +02:00
Common: Ensure VFS references not directly deleted.
This commit is contained in:
1 parent
84b7df62ab
commit
2fce2df7f6
3 files changed
+12
-4
No files matched your search
@@ -37,7 +37,10 @@ public:
|
||||
|
||||
class DirectoryReaderOpenFile : public VFSOpenFile {
|
||||
public:
|
||||
FILE *file;
|
||||
~DirectoryReaderOpenFile() {
|
||||
_dbg_assert_(file == nullptr);
|
||||
}
|
||||
FILE *file = nullptr;
|
||||
};
|
||||
|
||||
VFSFileReference *DirectoryReader::GetFile(const char *path) {
|
||||
@@ -80,6 +83,8 @@ size_t DirectoryReader::Read(VFSOpenFile *vfsOpenFile, void *buffer, size_t leng
|
||||
|
||||
void DirectoryReader::CloseFile(VFSOpenFile *vfsOpenFile) {
|
||||
DirectoryReaderOpenFile *openFile = (DirectoryReaderOpenFile *)vfsOpenFile;
|
||||
_dbg_assert_(openFile->file != nullptr);
|
||||
fclose(openFile->file);
|
||||
openFile->file = nullptr;
|
||||
delete openFile;
|
||||
}
|
||||
Reference in new issue
Block a user