1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-22 13:05:20 +02:00

Surface: Fixed memory leak in previous commit.

I forgot to initialize freeWhenDone in two of the three constructors.
This commit is contained in:
Maarten ter Huurne 2011-06-02 18:07:17 +02:00
parent 7dac306c16
commit 0c867aabbf

View File

@ -52,6 +52,7 @@ Surface::Surface(SDL_Surface *raw_, bool freeWhenDone_)
Surface::Surface(Surface *s) {
raw = SDL_DisplayFormat(s->raw);
freeWhenDone = true;
halfW = raw->w/2;
halfH = raw->h/2;
}
@ -59,6 +60,7 @@ Surface::Surface(Surface *s) {
Surface::Surface(const string &img, const string &skin) {
raw = NULL;
load(img, skin);
freeWhenDone = (raw != NULL);
halfW = raw->w/2;
halfH = raw->h/2;
}