From 80c92e403f3a167da3e4e3b55c0311a1ff333b0e Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Mon, 9 Nov 2015 15:07:51 +0100 Subject: Fix crash on client exit Wayland linked lists are implemented by having next and prev pointers in the objects themselves. This means that an object can only be in one list at the time. If the object is not removed from a list before being inserted into another, the original list is corrupted. Change-Id: Idc6cfc507f7d7ff30a365fda01c4f9729335ae09 Reviewed-by: Laszlo Agocs --- .../compositor/wayland-egl/waylandeglclientbufferintegration.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp index 5cea48a43..42636990f 100644 --- a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp +++ b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp @@ -113,6 +113,7 @@ public: { destroy_listener.d = this; destroy_listener.listener.notify = destroy_listener_callback; + wl_list_init(&destroy_listener.listener.link); } static void destroy_listener_callback(wl_listener *listener, void *data) { @@ -251,6 +252,7 @@ void WaylandEglClientBufferIntegration::initializeBuffer(struct ::wl_resource *b if (!buffer || d->buffers.contains(buffer)) return; + wl_list_remove(&d->destroy_listener.listener.link); wl_signal_add(&buffer->destroy_signal, &d->destroy_listener.listener); } -- cgit v1.2.3