From 31c69428639c0674339c3752c5401542d38693bc Mon Sep 17 00:00:00 2001 From: Nicolas James Date: Wed, 1 Apr 2026 00:49:34 +1100 Subject: Turn shared_ptr to unique_ptr in Context, strictly transfer ownership in notify_present --- src/queue_context.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/queue_context.cc') diff --git a/src/queue_context.cc b/src/queue_context.cc index e9f9c3c..b4591f8 100644 --- a/src/queue_context.cc +++ b/src/queue_context.cc @@ -96,7 +96,7 @@ void QueueContext::notify_submit( // mapping (might be empty, but handled with operator[]). auto& submissions = this->unpresented_submissions[present_id]; if (submissions == nullptr) { - submissions = std::make_shared(); + submissions = std::make_unique(); if (present_id) { this->present_id_ring.emplace_back(present_id); } @@ -119,10 +119,10 @@ void QueueContext::notify_present(const VkSwapchainKHR& swapchain, // We're avoiding a double hash here - don't use operator[] and erase. auto iter = this->unpresented_submissions.try_emplace(present_id).first; if (iter->second == nullptr) { - iter->second = std::make_shared(); + iter->second = std::make_unique(); } - this->device.notify_present(swapchain, iter->second); + this->device.notify_present(swapchain, std::move(iter->second)); // Important, we nuke the submission because now it's presented. this->unpresented_submissions.erase(iter); -- cgit v1.2.3