Fix use-after-free in FileAccess::exists

This commit is contained in:
Mikael Hermansson 2024-08-09 03:33:51 +02:00
parent 739019e4e4
commit 613600fa89

View file

@ -119,6 +119,10 @@ void PackedData::_free_packed_dirs(PackedDir *p_dir) {
} }
PackedData::~PackedData() { PackedData::~PackedData() {
if (singleton == this) {
singleton = nullptr;
}
for (int i = 0; i < sources.size(); i++) { for (int i = 0; i < sources.size(); i++) {
memdelete(sources[i]); memdelete(sources[i]);
} }