Remove unmatched malloc / new / new[], free / delete / delete [] (valgrind warnings)

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@2645 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: edb60b23f5f096f638cf72d6ffdc344633f078eb
Former-commit-id: 9ba065f10d0f3ad5f8bd51522763e5f333a66d8a
This commit is contained in:
martkelder 2010-08-10 09:01:37 +00:00
parent 60cf063264
commit 976d83e2e7
2 changed files with 6 additions and 6 deletions

View file

@ -307,8 +307,8 @@ grShutdownSmoke()
//~ tmp = smokeList->erase(tmp);
//~ }
smokeList->clear();
delete timeSmoke;
delete timeFire;
delete [] timeSmoke;
delete [] timeFire;
delete smokeList;
timeSmoke = NULL;

View file

@ -130,7 +130,7 @@ grSGIHeader::grSGIHeader(const char *fname, ssgTextureInfo* info)
return;
}
GLubyte *image = new GLubyte [sgihdr->xsize*sgihdr->ysize*sgihdr->zsize];
GLubyte *image = (GLubyte*)malloc( sizeof(GLubyte) * sgihdr->xsize*sgihdr->ysize*sgihdr->zsize );
GLubyte *ptr = image;
unsigned char *rbuf = new unsigned char[sgihdr->xsize];
@ -243,7 +243,7 @@ bool grMakeMipMaps (GLubyte *image, int xsize, int ysize, int zsize, int mipmap)
h2 = 1;
}
texels[l2] = new GLubyte[w2*h2*zsize];
texels[l2] = (GLubyte*)malloc( sizeof(GLubyte) * w2*h2*zsize );
for (int x2 = 0; x2 < w2; x2++) {
for (int y2 = 0; y2 < h2; y2++) {
@ -330,7 +330,7 @@ bool grMakeMipMaps (GLubyte *image, int xsize, int ysize, int zsize, int mipmap)
}
if (ww == 0) {
delete [] texels[0];
free( texels[0] );
xsize >>= 1;
ysize >>= 1;
for (int l = 0; texels [l] != NULL; l++) {
@ -376,7 +376,7 @@ bool grMakeMipMaps (GLubyte *image, int xsize, int ysize, int zsize, int mipmap)
}
map_level++ ;
delete [] texels[i];
free( texels[i] );
}
return true;