Merge pull request #15220 from unknownbrackets/vulkan-exit

Vulkan: Fix use-after-free on shutdown
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2021-12-10 10:37:43 +01:00
commit 7b07a1385a
2 files changed
+5 -2

No files matched your search

+1 -1
View File
@@ -449,7 +449,7 @@ void VulkanRenderManager::CompileThreadFunc() {
if (!run_) {
break;
}
for (auto entry : toCompile) {
for (auto &entry : toCompile) {
switch (entry.type) {
case CompileQueueEntry::Type::GRAPHICS:
entry.graphics->Create(vulkan_);
+4 -1
View File
@@ -37,7 +37,10 @@ void PipelineManagerVulkan::Clear() {
if (value->pipeline) {
VkPipeline pipeline = value->pipeline->pipeline;
vulkan_->Delete().QueueDeletePipeline(pipeline);
delete value->pipeline;
vulkan_->Delete().QueueCallback([](void *p) {
VKRGraphicsPipeline *pipeline = (VKRGraphicsPipeline *)p;
delete pipeline;
}, value->pipeline);
} else {
// Something went wrong.
ERROR_LOG(G3D, "Null pipeline found in PipelineManagerVulkan::Clear - didn't wait for asyncs?");