render/shm_allocator: make wlr_shm_allocator_create return a wlr_allocator

This commit is contained in:
Simon Zeni 2021-04-21 21:29:33 -04:00 committed by Simon Ser
parent c75aa71816
commit a8c91fbac9
4 changed files with 12 additions and 15 deletions

View file

@ -98,12 +98,13 @@ static const struct wlr_allocator_interface allocator_impl = {
.create_buffer = allocator_create_buffer,
};
struct wlr_shm_allocator *wlr_shm_allocator_create(void) {
struct wlr_allocator *wlr_shm_allocator_create(void) {
struct wlr_shm_allocator *allocator = calloc(1, sizeof(*allocator));
if (allocator == NULL) {
return NULL;
}
wlr_allocator_init(&allocator->base, &allocator_impl);
return allocator;
wlr_log(WLR_DEBUG, "Created shm allocator");
return &allocator->base;
}