Skip to content

Commit 06ded73

Browse files
committed
Fix #3090 metal texture memory leak
1 parent 18e5280 commit 06ded73

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

axmol/rhi/metal/TextureMTL.mm

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,14 @@ static bool isColorRenderable(PixelFormat textureFormat)
5656
updateTextureDesc(desc);
5757
}
5858

59-
TextureImpl::~TextureImpl() {}
59+
TextureImpl::~TextureImpl()
60+
{
61+
if (_mtlTexture != nil)
62+
{
63+
[_mtlTexture release];
64+
_mtlTexture = nil;
65+
}
66+
}
6067

6168
void TextureImpl::updateSamplerDesc(const SamplerDesc& desc)
6269
{

0 commit comments

Comments
 (0)