From 24db40779e46ceead0f4249d06af950501bcfb55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Mon, 20 Jun 2016 21:35:38 -0700 Subject: [PATCH] Cleanup. --- tools/texturec/texturec.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/texturec/texturec.cpp b/tools/texturec/texturec.cpp index c1c271fdd..687ccf82f 100644 --- a/tools/texturec/texturec.cpp +++ b/tools/texturec/texturec.cpp @@ -570,10 +570,13 @@ int main(int _argc, const char* _argv[]) const bool normalMap = cmdLine.hasArg('n', "normalmap"); const bool iqa = cmdLine.hasArg('\0', "iqa"); - uint32_t size = (uint32_t)bx::getSize(&reader); - const bgfx::Memory* mem = bgfx::alloc(size); - bx::read(&reader, mem->data, mem->size); - bx::close(&reader); + const bgfx::Memory* mem; + { + uint32_t size = (uint32_t)bx::getSize(&reader); + mem = bgfx::alloc(size); + bx::read(&reader, mem->data, mem->size); + bx::close(&reader); + } { using namespace bgfx;