This fixes a potential deadlock on exit.
Unified · Split
| @@ -247,7 +247,8 @@ void ff_vk_exec_pool_free(FFVulkanContext *s, FFVkExecPool *pool) · 246 unmodified lines | ||
| 247 | 247 | FFVkExecContext *e = &pool->contexts[i]; |
| 248 | 248 | |
| 249 | 249 | if (e->fence) { |
| 250 | − vk->WaitForFences(s->hwctx->act_dev, 1, &e->fence, VK_TRUE, UINT64_MAX); | |
| 250 | + if (e->had_submission) | |
| 251 | + vk->WaitForFences(s->hwctx->act_dev, 1, &e->fence, VK_TRUE, UINT64_MAX); | |
| 251 | 252 | vk->DestroyFence(s->hwctx->act_dev, e->fence, s->hwctx->alloc); |
| 252 | 253 | } |
| 253 | 254 | pthread_mutex_destroy(&e->lock); |