mirror of https://github.com/encounter/SDL.git
Fixed memory leak in WIN_CreateBlankCursor()
This commit is contained in:
parent
5ff42438e3
commit
0387bf821a
|
@ -175,11 +175,13 @@ WIN_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y)
|
||||||
static SDL_Cursor *
|
static SDL_Cursor *
|
||||||
WIN_CreateBlankCursor()
|
WIN_CreateBlankCursor()
|
||||||
{
|
{
|
||||||
|
SDL_Cursor *cursor = NULL;
|
||||||
SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormat(0, 32, 32, 32, SDL_PIXELFORMAT_ARGB8888);
|
SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormat(0, 32, 32, 32, SDL_PIXELFORMAT_ARGB8888);
|
||||||
if (surface) {
|
if (surface) {
|
||||||
return WIN_CreateCursor(surface, 0, 0);
|
cursor = WIN_CreateCursor(surface, 0, 0);
|
||||||
|
SDL_FreeSurface(surface);
|
||||||
}
|
}
|
||||||
return NULL;
|
return cursor;
|
||||||
}
|
}
|
||||||
|
|
||||||
static SDL_Cursor *
|
static SDL_Cursor *
|
||||||
|
|
Loading…
Reference in New Issue