diff --git a/linux_dmabuf.h b/linux_dmabuf.h index 834a48e32d..abf1793465 100644 --- a/linux_dmabuf.h +++ b/linux_dmabuf.h @@ -60,7 +60,7 @@ public: using Flags = KWayland::Server::LinuxDmabufUnstableV1Interface::Flags; explicit LinuxDmabuf(); - ~LinuxDmabuf(); + ~LinuxDmabuf() override; KWayland::Server::LinuxDmabufUnstableV1Buffer *importBuffer(const QVector &planes, uint32_t format, diff --git a/platformsupport/scenes/opengl/abstract_egl_backend.cpp b/platformsupport/scenes/opengl/abstract_egl_backend.cpp index 4eb36c314e..532ec279c0 100644 --- a/platformsupport/scenes/opengl/abstract_egl_backend.cpp +++ b/platformsupport/scenes/opengl/abstract_egl_backend.cpp @@ -66,7 +66,10 @@ AbstractEglBackend::AbstractEglBackend() connect(Compositor::self(), &Compositor::aboutToDestroy, this, &AbstractEglBackend::unbindWaylandDisplay); } -AbstractEglBackend::~AbstractEglBackend() = default; +AbstractEglBackend::~AbstractEglBackend() +{ + delete m_dmaBuf; +} void AbstractEglBackend::unbindWaylandDisplay() { @@ -171,7 +174,8 @@ void AbstractEglBackend::initWayland() } } - EglDmabuf::factory(this); + Q_ASSERT(!m_dmaBuf); + m_dmaBuf = EglDmabuf::factory(this); } void AbstractEglBackend::initClientExtensions() diff --git a/platformsupport/scenes/opengl/abstract_egl_backend.h b/platformsupport/scenes/opengl/abstract_egl_backend.h index 6a173d5c18..75d5467b9b 100644 --- a/platformsupport/scenes/opengl/abstract_egl_backend.h +++ b/platformsupport/scenes/opengl/abstract_egl_backend.h @@ -39,6 +39,8 @@ class BufferInterface; namespace KWin { +class EglDmabuf; + class KWIN_EXPORT AbstractEglBackend : public QObject, public OpenGLBackend { Q_OBJECT @@ -85,6 +87,7 @@ private: EGLContext m_context = EGL_NO_CONTEXT; EGLConfig m_config = nullptr; QList m_clientExtensions; + EglDmabuf *m_dmaBuf = nullptr; }; class KWIN_EXPORT AbstractEglTexture : public SceneOpenGLTexturePrivate diff --git a/platformsupport/scenes/opengl/egl_dmabuf.h b/platformsupport/scenes/opengl/egl_dmabuf.h index e01dc53269..a9244f7437 100644 --- a/platformsupport/scenes/opengl/egl_dmabuf.h +++ b/platformsupport/scenes/opengl/egl_dmabuf.h @@ -77,7 +77,7 @@ public: static EglDmabuf* factory(AbstractEglBackend *backend); explicit EglDmabuf(AbstractEglBackend *backend); - ~EglDmabuf(); + ~EglDmabuf() override; KWayland::Server::LinuxDmabufUnstableV1Buffer *importBuffer(const QVector &planes, uint32_t format,