Browse Source

Fix use-after-free in `FileAccess::exists`

Mikael Hermansson 1 year ago
parent
commit
613600fa89
1 changed files with 4 additions and 0 deletions
  1. 4 0
      core/io/file_access_pack.cpp

+ 4 - 0
core/io/file_access_pack.cpp

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