diff --git a/linux_dmabuf.h b/linux_dmabuf.h --- a/linux_dmabuf.h +++ b/linux_dmabuf.h @@ -60,7 +60,7 @@ 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.h b/platformsupport/scenes/opengl/abstract_egl_backend.h --- a/platformsupport/scenes/opengl/abstract_egl_backend.h +++ b/platformsupport/scenes/opengl/abstract_egl_backend.h @@ -39,6 +39,8 @@ namespace KWin { +class EglDmabuf; + class KWIN_EXPORT AbstractEglBackend : public QObject, public OpenGLBackend { Q_OBJECT @@ -85,6 +87,7 @@ 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/abstract_egl_backend.cpp b/platformsupport/scenes/opengl/abstract_egl_backend.cpp --- a/platformsupport/scenes/opengl/abstract_egl_backend.cpp +++ b/platformsupport/scenes/opengl/abstract_egl_backend.cpp @@ -66,7 +66,10 @@ connect(Compositor::self(), &Compositor::aboutToDestroy, this, &AbstractEglBackend::unbindWaylandDisplay); } -AbstractEglBackend::~AbstractEglBackend() = default; +AbstractEglBackend::~AbstractEglBackend() +{ + delete m_dmaBuf; +} void AbstractEglBackend::unbindWaylandDisplay() { @@ -171,7 +174,8 @@ } } - EglDmabuf::factory(this); + Q_ASSERT(!m_dmaBuf); + m_dmaBuf = EglDmabuf::factory(this); } void AbstractEglBackend::initClientExtensions() diff --git a/platformsupport/scenes/opengl/egl_dmabuf.h b/platformsupport/scenes/opengl/egl_dmabuf.h --- a/platformsupport/scenes/opengl/egl_dmabuf.h +++ b/platformsupport/scenes/opengl/egl_dmabuf.h @@ -77,7 +77,7 @@ static EglDmabuf* factory(AbstractEglBackend *backend); explicit EglDmabuf(AbstractEglBackend *backend); - ~EglDmabuf(); + ~EglDmabuf() override; KWayland::Server::LinuxDmabufUnstableV1Buffer *importBuffer(const QVector &planes, uint32_t format,