- fixed a few memory leaks
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-03-29 10:33:42 +00:00
parent 2f66c4953f
commit 3994006d7e
12 changed files with 64 additions and 33 deletions

View File

@@ -93,6 +93,7 @@ CardTexture::CardTexture(MTGCard * card, int _type): type(_type){
LOG("==Creating CardTexture Object");
char filename[100];
quad = NULL;
tex = NULL;
nbpixels = 0;
lastTime = 0;
if (type == CACHE_THUMB){
@@ -103,7 +104,8 @@ CardTexture::CardTexture(MTGCard * card, int _type): type(_type){
#ifdef WIN32
OutputDebugString(filename);
#endif
tex = JRenderer::GetInstance()->LoadTexture(filename, false);
if (fileExists(filename))
tex = JRenderer::GetInstance()->LoadTexture(filename, false);
if (tex){
quad = NEW JQuad(tex, 0.0f, 0.0f, tex->mWidth, tex->mHeight);
nbpixels = tex->mTexHeight * tex->mTexWidth;
@@ -177,3 +179,7 @@ void SampleCache::cleanCache(){
SampleCache::~SampleCache(){
cleanCache();
}
void SampleCache::DestroyInstance(){
SAFE_DELETE(mInstance);
}