From 1dafad9375da7f2bd92bf95c852003b2021de384 Mon Sep 17 00:00:00 2001 From: xXSeraphimXx Date: Wed, 7 Sep 2016 10:25:01 +0200 Subject: [PATCH] Revert "Fixed bugs" This reverts commit 91a57a6ecf0ce9e65403ed02c50064c7874754d7. --- vulkan/vulkan.hpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/vulkan/vulkan.hpp b/vulkan/vulkan.hpp index 8ae4657..7bb1c09 100644 --- a/vulkan/vulkan.hpp +++ b/vulkan/vulkan.hpp @@ -936,15 +936,17 @@ namespace vk std::function delete_func; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - bool released = false; + bool released = false, auto_release_copies = false; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ using INS = vk::Instance; using DEV = vk::Device; public: scoped_handle(const scoped_handle& s) { + std::cout << "copy constructor" << std::endl; this->object = s.object; this->delete_func = s.delete_func; + this->released = s.auto_release_copies; } template @@ -1054,11 +1056,12 @@ namespace vk } void destroy() { - if(released){ - if (this->object) - this->delete_func(this->object); - this->object = VK_NULL_HANDLE; + if (this->object && released) { + std::cout << "Deleting object of type " << typeid(object).name() << std::endl; + this->delete_func(this->object); } + + this->object = VK_NULL_HANDLE; } #endif bool isEmpty() {