Fix major memory leak in Bitmap::initFromSurface

c89f3d5bd7 accidentally completely removed the call to free the surface when successfully creating a texture.
This commit is contained in:
Wayward Heart 2024-06-02 00:44:09 -05:00
parent 23e9f6cb1c
commit 9221cc7ec2

View file

@ -872,6 +872,8 @@ void Bitmap::initFromSurface(SDL_Surface *imgSurf, Bitmap *hiresBitmap, bool for
TEX::bind(p->gl.tex);
TEX::uploadImage(p->gl.width, p->gl.height, imgSurf->pixels, GL_RGBA);
SDL_FreeSurface(imgSurf);
}
p->addTaintedArea(rect());