diff options
Diffstat (limited to 'src/video_core/vulkan_common/vulkan_wrapper.h')
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_wrapper.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/video_core/vulkan_common/vulkan_wrapper.h b/src/video_core/vulkan_common/vulkan_wrapper.h index 1bb8a47bdf..aa9fb8e17b 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.h +++ b/src/video_core/vulkan_common/vulkan_wrapper.h @@ -430,6 +430,15 @@ public: return handle != nullptr; } + /** + * Releases ownership of the managed handle. + * The caller is responsible for managing the lifetime of the returned handle. + * The Handle object becomes invalid after this call. + */ + Type release() noexcept { + return std::exchange(handle, nullptr); + } + protected: Type handle = nullptr; OwnerType owner = nullptr; @@ -501,6 +510,15 @@ public: return handle != nullptr; } + /** + * Releases ownership of the managed handle. + * The caller is responsible for managing the lifetime of the returned handle. + * The Handle object becomes invalid after this call. + */ + Type release() noexcept { + return std::exchange(handle, nullptr); + } + protected: Type handle = nullptr; const Dispatch* dld = nullptr; |
