summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/compositor/compositor_api/qwaylandcompositor.cpp3
-rw-r--r--src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp8
2 files changed, 11 insertions, 0 deletions
diff --git a/src/compositor/compositor_api/qwaylandcompositor.cpp b/src/compositor/compositor_api/qwaylandcompositor.cpp
index 173b50ce..a0d69c52 100644
--- a/src/compositor/compositor_api/qwaylandcompositor.cpp
+++ b/src/compositor/compositor_api/qwaylandcompositor.cpp
@@ -243,6 +243,9 @@ QWaylandCompositorPrivate::~QWaylandCompositorPrivate()
delete data_device_manager;
#endif
+ // Some client buffer integrations need to clean up before the destroying the wl_display
+ client_buffer_integration.reset();
+
wl_display_destroy(display);
}
diff --git a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp
index 2cadf850..88dab2ab 100644
--- a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp
+++ b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp
@@ -186,6 +186,7 @@ public:
EGLDisplay egl_display = EGL_NO_DISPLAY;
bool valid = false;
bool display_bound = false;
+ ::wl_display *wlDisplay = nullptr;
QOffscreenSurface *offscreenSurface = nullptr;
QOpenGLContext *localContext = nullptr;
QVector<QOpenGLTexture *> orphanedTextures;
@@ -394,6 +395,12 @@ WaylandEglClientBufferIntegration::WaylandEglClientBufferIntegration()
WaylandEglClientBufferIntegration::~WaylandEglClientBufferIntegration()
{
WaylandEglClientBufferIntegrationPrivate::shuttingDown = true;
+ Q_D(WaylandEglClientBufferIntegration);
+ if (d->egl_unbind_wayland_display && d->display_bound) {
+ Q_ASSERT(d->wlDisplay);
+ if (!d->egl_unbind_wayland_display(d->egl_display, d->wlDisplay))
+ qWarning() << "Qt Wayland Compositor: eglUnbindWaylandDisplayWL failed";
+ }
}
void WaylandEglClientBufferIntegration::initializeHardware(struct wl_display *display)
@@ -450,6 +457,7 @@ void WaylandEglClientBufferIntegration::initializeHardware(struct wl_display *di
qWarning("QtCompositor: Could not bind Wayland display. Ignoring.");
}
}
+ d->wlDisplay = display;
}
d->funcs = new QEGLStreamConvenience;