From 20345e31bc78b4072c3c876f3c6f75559ea15533 Mon Sep 17 00:00:00 2001 From: Thomas Edvalson Date: Mon, 25 Jul 2016 05:13:04 -0400 Subject: [PATCH] Fix Texture destructor bug that crashed when texture was empty --- src/cpp3ds/Graphics/Texture.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cpp3ds/Graphics/Texture.cpp b/src/cpp3ds/Graphics/Texture.cpp index 6265daa..f3d2855 100644 --- a/src/cpp3ds/Graphics/Texture.cpp +++ b/src/cpp3ds/Graphics/Texture.cpp @@ -152,11 +152,12 @@ m_cacheId (getUniqueId()) //////////////////////////////////////////////////////////// Texture::~Texture() { - if (m_ownsData) - C3D_TexDelete(m_texture); - if (m_texture) + { + if (m_ownsData) + C3D_TexDelete(m_texture); delete m_texture; + } }