Fix a memory leak in the previous commit.
This commit is contained in:
parent
c63c27ae5e
commit
e9d42a91ce
1 changed files with 1 additions and 0 deletions
|
@ -51,6 +51,7 @@ ttexture::ttexture(SDL_Renderer& renderer,
|
|||
texture_ = SDL_CreateTextureFromSurface(&renderer, img);
|
||||
|
||||
if (texture_ == NULL) {
|
||||
SDL_FreeSurface(img);
|
||||
throw texception("Failed to create SDL_Texture object.", true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue