diff --git a/VTFLib/VTFFile.cpp b/VTFLib/VTFFile.cpp index 6561684..4e7dcb1 100644 --- a/VTFLib/VTFFile.cpp +++ b/VTFLib/VTFFile.cpp @@ -955,6 +955,17 @@ vlBool CVTFFile::Create(vlUInt uiWidth, vlUInt uiHeight, vlUInt uiFrames, vlUInt this->SetStartFrame(VTFCreateOptions.uiStartFrame); this->SetBumpmapScale(VTFCreateOptions.sBumpScale); + if(lpNewImageDataRGBA8888 != 0) + { + for(vlUInt i = 0; i < uiCount; i++) + { + delete []lpNewImageDataRGBA8888[i]; + } + delete []lpNewImageDataRGBA8888; + } + + this->Destroy(); + return vlTrue; } catch(...)