mirror of
https://github.com/yuzu-emu/FasTC
synced 2024-11-25 07:49:07 +00:00
Fixed scoped allocator -- this should have never worked
This commit is contained in:
parent
8a1906e7b7
commit
6f2ee27a0e
2 changed files with 2 additions and 8 deletions
|
@ -63,12 +63,7 @@ namespace FasTC {
|
|||
T *m_Ptr;
|
||||
ScopedAllocator() : m_Ptr(NULL) { }
|
||||
public:
|
||||
static ScopedAllocator<T> Create(uint32 nBytes) {
|
||||
ScopedAllocator<T> actr;
|
||||
actr.m_Ptr = new T[nBytes];
|
||||
return actr;
|
||||
}
|
||||
|
||||
ScopedAllocator<T>(uint32 nBytes) : m_Ptr(new T[nBytes]) { }
|
||||
~ScopedAllocator() {
|
||||
if(m_Ptr) {
|
||||
delete [] m_Ptr;
|
||||
|
|
|
@ -205,8 +205,7 @@ bool ImageLoaderKTX::ReadData() {
|
|||
const uint8 *imgData = rdr.GetData() + bytesOfKeyValueData;
|
||||
while(rdr.GetData() < imgData) {
|
||||
LOAD(keyAndValueByteSize);
|
||||
FasTC::ScopedAllocator<uint8> keyValueData =
|
||||
FasTC::ScopedAllocator<uint8>::Create(keyAndValueByteSize);
|
||||
FasTC::ScopedAllocator<uint8> keyValueData(keyAndValueByteSize);
|
||||
if(!keyValueData) {
|
||||
fprintf(stderr, "KTX loader - out of memory.\n");
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue