Guard against releasing NULL textures.

ANGLEBUG=265 TRAC #19196 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@905 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent d3552230
#define MAJOR_VERSION 1 #define MAJOR_VERSION 1
#define MINOR_VERSION 0 #define MINOR_VERSION 0
#define BUILD_VERSION 0 #define BUILD_VERSION 0
#define BUILD_REVISION 904 #define BUILD_REVISION 905
#define STRINGIFY(x) #x #define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x) #define MACRO_STRINGIFY(x) STRINGIFY(x)
......
...@@ -1656,7 +1656,10 @@ TextureStorage2D::TextureStorage2D(int levels, D3DFORMAT format, int width, int ...@@ -1656,7 +1656,10 @@ TextureStorage2D::TextureStorage2D(int levels, D3DFORMAT format, int width, int
TextureStorage2D::~TextureStorage2D() TextureStorage2D::~TextureStorage2D()
{ {
if (mTexture)
{
mTexture->Release(); mTexture->Release();
}
} }
IDirect3DSurface9 *TextureStorage2D::getSurfaceLevel(int level) IDirect3DSurface9 *TextureStorage2D::getSurfaceLevel(int level)
...@@ -2294,7 +2297,10 @@ TextureStorageCubeMap::TextureStorageCubeMap(int levels, D3DFORMAT format, int s ...@@ -2294,7 +2297,10 @@ TextureStorageCubeMap::TextureStorageCubeMap(int levels, D3DFORMAT format, int s
TextureStorageCubeMap::~TextureStorageCubeMap() TextureStorageCubeMap::~TextureStorageCubeMap()
{ {
if (mTexture)
{
mTexture->Release(); mTexture->Release();
}
} }
IDirect3DSurface9 *TextureStorageCubeMap::getCubeMapSurface(GLenum faceTarget, int level) IDirect3DSurface9 *TextureStorageCubeMap::getCubeMapSurface(GLenum faceTarget, int level)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment