mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-26 03:06:15 +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:
parent
7dac306c16
commit
0c867aabbf
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user