Fix surface destruction

This commit is contained in:
nyorain 2017-08-09 16:25:54 +02:00
parent cf9ee6ce3f
commit fb58307a50
1 changed files with 1 additions and 2 deletions

View File

@ -6,8 +6,6 @@
#include <wlr/types/wlr_surface.h> #include <wlr/types/wlr_surface.h>
static void surface_destroy(struct wl_client *client, struct wl_resource *resource) { static void surface_destroy(struct wl_client *client, struct wl_resource *resource) {
struct wlr_surface *surface = wl_resource_get_user_data(resource);
wl_signal_emit(&surface->signals.destroy, surface);
wl_resource_destroy(resource); wl_resource_destroy(resource);
} }
@ -104,6 +102,7 @@ static void destroy_surface(struct wl_resource *resource) {
struct wlr_surface *surface = wl_resource_get_user_data(resource); struct wlr_surface *surface = wl_resource_get_user_data(resource);
wl_signal_emit(&surface->signals.destroy, surface); wl_signal_emit(&surface->signals.destroy, surface);
wlr_texture_destroy(surface->texture); wlr_texture_destroy(surface->texture);
free(surface);
} }
struct wlr_surface *wlr_surface_create(struct wl_resource *res, struct wlr_surface *wlr_surface_create(struct wl_resource *res,