mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-14 06:59:43 -05:00
types/wlr_xcursor_manager: Add caching textures
This commit is contained in:
parent
2fcb2b95fc
commit
c5bd304795
5 changed files with 98 additions and 37 deletions
|
|
@ -57,7 +57,7 @@ static struct wlr_xcursor *xcursor_create_from_data(
|
|||
}
|
||||
|
||||
cursor->image_count = 1;
|
||||
cursor->images = malloc(sizeof(*cursor->images));
|
||||
cursor->images = calloc(1, sizeof(*cursor->images));
|
||||
if (!cursor->images) {
|
||||
goto err_free_cursor;
|
||||
}
|
||||
|
|
@ -137,7 +137,7 @@ static struct wlr_xcursor *xcursor_create_from_xcursor_images(
|
|||
return NULL;
|
||||
}
|
||||
|
||||
cursor->images = malloc(images->nimage * sizeof(cursor->images[0]));
|
||||
cursor->images = calloc(images->nimage, sizeof(cursor->images[0]));
|
||||
if (!cursor->images) {
|
||||
free(cursor);
|
||||
return NULL;
|
||||
|
|
@ -147,7 +147,7 @@ static struct wlr_xcursor *xcursor_create_from_xcursor_images(
|
|||
cursor->total_delay = 0;
|
||||
|
||||
for (i = 0; i < images->nimage; i++) {
|
||||
image = malloc(sizeof(*image));
|
||||
image = calloc(1, sizeof(*image));
|
||||
if (image == NULL) {
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue