diff --git a/Base/include/FasTC/ScopedAllocator.h b/Base/include/FasTC/ScopedAllocator.h index 34e4c5d..e13f306 100644 --- a/Base/include/FasTC/ScopedAllocator.h +++ b/Base/include/FasTC/ScopedAllocator.h @@ -63,12 +63,7 @@ namespace FasTC { T *m_Ptr; ScopedAllocator() : m_Ptr(NULL) { } public: - static ScopedAllocator Create(uint32 nBytes) { - ScopedAllocator actr; - actr.m_Ptr = new T[nBytes]; - return actr; - } - + ScopedAllocator(uint32 nBytes) : m_Ptr(new T[nBytes]) { } ~ScopedAllocator() { if(m_Ptr) { delete [] m_Ptr; diff --git a/IO/src/ImageLoaderKTX.cpp b/IO/src/ImageLoaderKTX.cpp index f4ce1d5..003392b 100644 --- a/IO/src/ImageLoaderKTX.cpp +++ b/IO/src/ImageLoaderKTX.cpp @@ -205,8 +205,7 @@ bool ImageLoaderKTX::ReadData() { const uint8 *imgData = rdr.GetData() + bytesOfKeyValueData; while(rdr.GetData() < imgData) { LOAD(keyAndValueByteSize); - FasTC::ScopedAllocator keyValueData = - FasTC::ScopedAllocator::Create(keyAndValueByteSize); + FasTC::ScopedAllocator keyValueData(keyAndValueByteSize); if(!keyValueData) { fprintf(stderr, "KTX loader - out of memory.\n"); return false;