1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-31 18:41:20 +00:00

Delete rendering device on the same thread it was created

This commit is contained in:
Olle Lukowski
2025-03-03 21:34:10 +01:00
parent 1753893c60
commit 3f1594ab90

View File

@@ -259,6 +259,14 @@ void BetsyCompressor::_thread_exit() {
compress_rd->free(cached_shaders[i].compiled);
}
}
// Free the RD (and RCD if necessary).
memdelete(compress_rd);
compress_rd = nullptr;
if (compress_rcd != nullptr) {
memdelete(compress_rcd);
compress_rcd = nullptr;
}
}
}
@@ -268,16 +276,6 @@ void BetsyCompressor::finish() {
WorkerThreadPool::get_singleton()->wait_for_task_completion(task_id);
task_id = WorkerThreadPool::INVALID_TASK_ID;
}
if (compress_rd != nullptr) {
// Free the RD (and RCD if necessary).
memdelete(compress_rd);
compress_rd = nullptr;
if (compress_rcd != nullptr) {
memdelete(compress_rcd);
compress_rcd = nullptr;
}
}
}
// Helper functions.