Skip to content

Commit

Permalink
Merge pull request #15220 from unknownbrackets/vulkan-exit
Browse files Browse the repository at this point in the history
Vulkan: Fix use-after-free on shutdown
  • Loading branch information
hrydgard committed Dec 10, 2021
2 parents 97f3b47 + fe7b573 commit 7b07a13
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Common/GPU/Vulkan/VulkanRenderManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_);
Expand Down
5 changes: 4 additions & 1 deletion GPU/Vulkan/PipelineManagerVulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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?");
Expand Down

0 comments on commit 7b07a13

Please sign in to comment.