Fix fileref memory leak

This commit is contained in:
Henrik Rydgård 2023-03-09 00:33:37 +01:00
parent ef14f28099
commit 03df5b7831
2 changed files with 5 additions and 1 deletions

View file

@ -1169,6 +1169,11 @@ ReplacedTexture::~ReplacedTexture() {
threadWaitable_->WaitAndRelease();
threadWaitable_ = nullptr;
}
for (auto &level : levels_) {
vfs_->ReleaseFile(level.fileRef);
level.fileRef = nullptr;
}
}
bool ReplacedTexture::CopyLevelTo(int level, void *out, int rowPitch) {

View file

@ -150,7 +150,6 @@ struct ReplacedTexture {
}
bool IsReady(double budget);
bool CopyLevelTo(int level, void *out, int rowPitch);
protected: