Commit b82840d7 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

drm: Don't call virtual methods from a parent class destructor

We'd be relying on AbstractEglDrmBackend on calling cleanup but we'd be
doing it when cleanupSurfaces cannot be reached out anymore, turning it
into a half-baked cleanup.

Instead call cleanup from the leaf class destructors.
parent 4c74a240
......@@ -24,11 +24,6 @@ AbstractEglDrmBackend::AbstractEglDrmBackend(DrmBackend *drmBackend, DrmGpu *gpu
connect(m_gpu, &DrmGpu::outputDisabled, this, &AbstractEglDrmBackend::removeOutput);
}
AbstractEglDrmBackend::~AbstractEglDrmBackend()
{
cleanup();
}
void AbstractEglDrmBackend::screenGeometryChanged(const QSize &size)
{
Q_UNUSED(size)
......
......@@ -22,8 +22,6 @@ class DrmOutput;
class AbstractEglDrmBackend : public AbstractEglBackend
{
public:
~AbstractEglDrmBackend();
void screenGeometryChanged(const QSize &size) override;
virtual int screenCount() const = 0;
......
......@@ -41,6 +41,11 @@ EglGbmBackend::EglGbmBackend(DrmBackend *drmBackend, DrmGpu *gpu)
{
}
EglGbmBackend::~EglGbmBackend()
{
cleanup();
}
void EglGbmBackend::cleanupSurfaces()
{
for (auto it = m_outputs.begin(); it != m_outputs.end(); ++it) {
......
......@@ -38,6 +38,7 @@ class EglGbmBackend : public AbstractEglDrmBackend
Q_OBJECT
public:
EglGbmBackend(DrmBackend *drmBackend, DrmGpu *gpu);
~EglGbmBackend() override;
SceneOpenGLTexturePrivate *createBackendTexture(SceneOpenGLTexture *texture) override;
QRegion beginFrame(int screenId) override;
......
......@@ -75,6 +75,11 @@ EglStreamBackend::EglStreamBackend(DrmBackend *drmBackend, DrmGpu *gpu)
{
}
EglStreamBackend::~EglStreamBackend()
{
cleanup();
}
void EglStreamBackend::cleanupSurfaces()
{
for (auto it = m_outputs.constBegin(); it != m_outputs.constEnd(); ++it) {
......
......@@ -27,6 +27,7 @@ class EglStreamBackend : public AbstractEglDrmBackend
Q_OBJECT
public:
EglStreamBackend(DrmBackend *b, DrmGpu *gpu);
~EglStreamBackend() override;
SceneOpenGLTexturePrivate *createBackendTexture(SceneOpenGLTexture *texture) override;
QRegion beginFrame(int screenId) override;
void endFrame(int screenId, const QRegion &damage, const QRegion &damagedRegion) override;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment