diff --git a/src/renderer_mtl.mm b/src/renderer_mtl.mm index cf00e82cc5..807bd9d106 100644 --- a/src/renderer_mtl.mm +++ b/src/renderer_mtl.mm @@ -3174,8 +3174,6 @@ void writeString(bx::WriterI* _writer, const char* _str) m_ptrStencil = s_renderMtl->m_device.newTextureWithDescriptor(desc); } - MTL_RELEASE(desc, 0); - uint8_t* temp = NULL; if (convert) { @@ -3252,6 +3250,8 @@ void writeString(bx::WriterI* _writer, const char* _str) depth >>= 1; } } + + MTL_RELEASE(desc, 0); if (NULL != temp) {