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
@@ -197,8 +197,12 @@ public:
|
||||
|
||||
class ZipFileReaderOpenFile : public VFSOpenFile {
|
||||
public:
|
||||
~ZipFileReaderOpenFile() {
|
||||
// Needs to be closed properly and unlocked.
|
||||
_dbg_assert_(zf == nullptr);
|
||||
}
|
||||
ZipFileReaderFileReference *reference;
|
||||
zip_file_t *zf;
|
||||
zip_file_t *zf = nullptr;
|
||||
};
|
||||
|
||||
static constexpr zip_uint64_t INVALID_ZIP_SIZE = 0xFFFFFFFFFFFFFFFFULL;
|
||||
@@ -270,6 +274,7 @@ void ZipFileReader::CloseFile(VFSOpenFile *vfsOpenFile) {
|
||||
ZipFileReaderOpenFile *file = (ZipFileReaderOpenFile *)vfsOpenFile;
|
||||
_dbg_assert_(file->zf != nullptr);
|
||||
zip_fclose(file->zf);
|
||||
file->zf = nullptr;
|
||||
lock_.unlock();
|
||||
delete file;
|
||||
}
|
||||
Reference in new issue
Block a user