aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornyorain <nyorain@gmail.com>2017-06-20 19:01:20 +0200
committernyorain <nyorain@gmail.com>2017-06-20 19:01:20 +0200
commit51f35e7af0f7f01381b702b7630763fb9354701a (patch)
tree57bd1e96a9c5c6e368ed9aba6b8323ea3420a59b
parenta96d90dec451b38a42039eed09c7edf9858d2597 (diff)
Cleanup some leaks/incorrect destructions
-rw-r--r--backend/wayland/backend.c7
-rw-r--r--backend/wayland/output.c4
-rw-r--r--backend/wayland/wl_seat.c2
3 files changed, 12 insertions, 1 deletions
diff --git a/backend/wayland/backend.c b/backend/wayland/backend.c
index e57cfed9..9623a168 100644
--- a/backend/wayland/backend.c
+++ b/backend/wayland/backend.c
@@ -6,6 +6,7 @@
#include <wlr/types.h>
#include "backend/wayland.h"
#include "common/log.h"
+#include "types.h"
#include <EGL/egl.h>
#include <EGL/eglext.h>
@@ -79,6 +80,12 @@ static void wlr_wl_backend_destroy(struct wlr_backend_state *state) {
wlr_output_destroy(state->outputs[i]);
}
+ for (size_t i = 0; state->devices && i < state->devices->length; ++i) {
+ wlr_input_device_destroy(state->devices->items[i]);
+ }
+
+ list_free(state->devices);
+
wlr_egl_free(&state->egl);
free(state->outputs);
if (state->seat) wl_seat_destroy(state->seat);
diff --git a/backend/wayland/output.c b/backend/wayland/output.c
index 3ec167bc..32f2deae 100644
--- a/backend/wayland/output.c
+++ b/backend/wayland/output.c
@@ -83,7 +83,9 @@ static bool wlr_wl_output_move_cursor(struct wlr_output_state *output,
}
static void wlr_wl_output_destroy(struct wlr_output_state *output) {
- // TODO: free egl surface
+ if(output->frame_callback) wl_callback_destroy(output->frame_callback);
+ eglDestroySurface(output->backend->egl.display, output->surface);
+ wl_egl_window_destroy(output->egl_window);
wl_shell_surface_destroy(output->shell_surface);
wl_surface_destroy(output->surface);
free(output);
diff --git a/backend/wayland/wl_seat.c b/backend/wayland/wl_seat.c
index d56f7d74..240cbbb0 100644
--- a/backend/wayland/wl_seat.c
+++ b/backend/wayland/wl_seat.c
@@ -61,6 +61,7 @@ static void seat_handle_capabilities(void *data, struct wl_seat *wl_seat,
}
wlr_device->pointer = wlr_pointer_create(NULL, NULL);
+ list_add(state->devices, wlr_device);
wl_signal_emit(&state->backend->events.input_add, wlr_device);
}
if ((caps & WL_SEAT_CAPABILITY_KEYBOARD)) {
@@ -75,6 +76,7 @@ static void seat_handle_capabilities(void *data, struct wl_seat *wl_seat,
}
wlr_device->keyboard = wlr_keyboard_create(NULL, NULL);
+ list_add(state->devices, wlr_device);
wl_signal_emit(&state->backend->events.input_add, wlr_device);
}