mirror of https://github.com/encounter/SDL.git
Fixed memory leak in game controller test program.
This commit is contained in:
parent
63f2ec8e57
commit
6a9a8b682c
|
@ -181,6 +181,8 @@ WatchGameController(SDL_GameController * gamecontroller)
|
||||||
window = SDL_CreateWindow(title, SDL_WINDOWPOS_CENTERED,
|
window = SDL_CreateWindow(title, SDL_WINDOWPOS_CENTERED,
|
||||||
SDL_WINDOWPOS_CENTERED, SCREEN_WIDTH,
|
SDL_WINDOWPOS_CENTERED, SCREEN_WIDTH,
|
||||||
SCREEN_HEIGHT, 0);
|
SCREEN_HEIGHT, 0);
|
||||||
|
SDL_free(title);
|
||||||
|
title = NULL;
|
||||||
if (window == NULL) {
|
if (window == NULL) {
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create window: %s\n", SDL_GetError());
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create window: %s\n", SDL_GetError());
|
||||||
return SDL_FALSE;
|
return SDL_FALSE;
|
||||||
|
|
Loading…
Reference in New Issue