From 50a97671ab2a773fe355a4eebf16936c3021382f Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Wed, 29 Nov 2006 22:59:33 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@752 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/rendergl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/src/rendergl.cpp b/source/src/rendergl.cpp index c717f3c9..c57167d0 100644 --- a/source/src/rendergl.cpp +++ b/source/src/rendergl.cpp @@ -104,10 +104,12 @@ GLuint installtex(const char *texname, int &xs, int &ys, bool clamp) { xs = s->w; ys = s->h; + delete[] scaledimg; + scaledimg = (uchar *)s->pixels; }; }; if(gluBuild2DMipmaps(GL_TEXTURE_2D, mode, xs, ys, mode, GL_UNSIGNED_BYTE, scaledimg)) fatal("could not build mipmaps"); - if(scaledimg != (uchar *)s->pixels) delete[] scaledimg; + if(xs!=s->w) delete[] scaledimg; SDL_FreeSurface(s); return tnum; };