mirror of
https://github.com/labwc/labwc.git
synced 2025-11-05 13:29:58 -05:00
common: Add additional memory utilities (xzalloc() etc.)
This commit is contained in:
parent
b89f7bfc0d
commit
cb40cdc36c
35 changed files with 193 additions and 167 deletions
|
|
@ -5,6 +5,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <wlr/types/wlr_scene.h>
|
||||
#include "common/graphic-helpers.h"
|
||||
#include "common/mem.h"
|
||||
|
||||
static void
|
||||
multi_rect_destroy_notify(struct wl_listener *listener, void *data)
|
||||
|
|
@ -16,7 +17,7 @@ multi_rect_destroy_notify(struct wl_listener *listener, void *data)
|
|||
struct multi_rect *
|
||||
multi_rect_create(struct wlr_scene_tree *parent, float *colors[3], int line_width)
|
||||
{
|
||||
struct multi_rect *rect = calloc(1, sizeof(*rect));
|
||||
struct multi_rect *rect = xzalloc(sizeof(*rect));
|
||||
rect->line_width = line_width;
|
||||
rect->tree = wlr_scene_tree_create(parent);
|
||||
rect->destroy.notify = multi_rect_destroy_notify;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue