Don't destroy null-objects in UniqueHandle (Fixes #171).

This commit is contained in:
Daniel Kirchner 2018-01-14 10:38:05 +01:00 committed by Markus Tavenrath
parent c548ea4bf2
commit 05586ce4a2
2 changed files with 4 additions and 4 deletions

View File

@ -594,7 +594,7 @@ const std::string uniqueHandleHeader = R"(
~UniqueHandle()
{
this->destroy( m_value );
if ( m_value ) this->destroy( m_value );
}
UniqueHandle & operator=( UniqueHandle const& ) = delete;
@ -645,7 +645,7 @@ const std::string uniqueHandleHeader = R"(
{
if ( m_value != value )
{
this->destroy( m_value );
if ( m_value ) this->destroy( m_value );
m_value = value;
}
}

View File

@ -351,7 +351,7 @@ namespace VULKAN_HPP_NAMESPACE
~UniqueHandle()
{
this->destroy( m_value );
if ( m_value ) this->destroy( m_value );
}
UniqueHandle & operator=( UniqueHandle const& ) = delete;
@ -402,7 +402,7 @@ namespace VULKAN_HPP_NAMESPACE
{
if ( m_value != value )
{
this->destroy( m_value );
if ( m_value ) this->destroy( m_value );
m_value = value;
}
}