Fixed bugs

This commit is contained in:
xXSeraphimXx 2016-09-07 10:06:36 +02:00
parent 4690aee2df
commit 91a57a6ecf

View File

@ -936,17 +936,15 @@ namespace vk
std::function<void(T object)> delete_func;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
bool released = false, auto_release_copies = false;
bool released = false;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
using INS = vk::Instance; using DEV = vk::Device;
public:
scoped_handle(const scoped_handle<T>& s) {
std::cout << "copy constructor" << std::endl;
this->object = s.object;
this->delete_func = s.delete_func;
this->released = s.auto_release_copies;
}
template<typename Fnc, typename alloc>
@ -1056,12 +1054,11 @@ namespace vk
}
void destroy() {
if (this->object && released) {
std::cout << "Deleting object of type " << typeid(object).name() << std::endl;
this->delete_func(this->object);
if(released){
if (this->object)
this->delete_func(this->object);
this->object = VK_NULL_HANDLE;
}
this->object = VK_NULL_HANDLE;
}
#endif
bool isEmpty() {