mirror of https://github.com/encounter/SDL.git
X11: use SDL_malloc
This commit is contained in:
parent
19bf36db15
commit
9fcc630fb3
|
@ -35,7 +35,7 @@ X11_CreateShaper(SDL_Window* window) {
|
||||||
|
|
||||||
#if SDL_VIDEO_DRIVER_X11_XSHAPE
|
#if SDL_VIDEO_DRIVER_X11_XSHAPE
|
||||||
if (SDL_X11_HAVE_XSHAPE) { /* Make sure X server supports it. */
|
if (SDL_X11_HAVE_XSHAPE) { /* Make sure X server supports it. */
|
||||||
result = malloc(sizeof(SDL_WindowShaper));
|
result = SDL_malloc(sizeof(SDL_WindowShaper));
|
||||||
result->window = window;
|
result->window = window;
|
||||||
result->mode.mode = ShapeModeDefault;
|
result->mode.mode = ShapeModeDefault;
|
||||||
result->mode.parameters.binarizationCutoff = 1;
|
result->mode.parameters.binarizationCutoff = 1;
|
||||||
|
@ -65,8 +65,8 @@ X11_ResizeWindowShape(SDL_Window* window) {
|
||||||
if(data->bitmapsize != bitmapsize || data->bitmap == NULL) {
|
if(data->bitmapsize != bitmapsize || data->bitmap == NULL) {
|
||||||
data->bitmapsize = bitmapsize;
|
data->bitmapsize = bitmapsize;
|
||||||
if(data->bitmap != NULL)
|
if(data->bitmap != NULL)
|
||||||
free(data->bitmap);
|
SDL_free(data->bitmap);
|
||||||
data->bitmap = malloc(data->bitmapsize);
|
data->bitmap = SDL_malloc(data->bitmapsize);
|
||||||
if(data->bitmap == NULL) {
|
if(data->bitmap == NULL) {
|
||||||
return SDL_SetError("Could not allocate memory for shaped-window bitmap.");
|
return SDL_SetError("Could not allocate memory for shaped-window bitmap.");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue