Fix heap-use-after-free when resource loaded with load_threaded_request is never fetched
Co-authored-by: Pedro J. Estébanez <pedrojrulez@gmail.com>
This commit is contained in:
parent
8c25a98fdf
commit
dc7e309f48
|
@ -1053,8 +1053,9 @@ void ResourceLoader::clear_thread_load_tasks() {
|
|||
thread_load_mutex.lock();
|
||||
}
|
||||
|
||||
for (KeyValue<String, LoadToken *> &E : user_load_tokens) {
|
||||
memdelete(E.value);
|
||||
while (user_load_tokens.begin()) {
|
||||
// User load tokens remove themselves from the map on destruction.
|
||||
memdelete(user_load_tokens.begin()->value);
|
||||
}
|
||||
user_load_tokens.clear();
|
||||
|
||||
|
|
Loading…
Reference in New Issue