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.
This commit is contained in:
parent
4c74a24059
commit
b82840d7e0
6 changed files with 12 additions and 7 deletions
|
@ -24,11 +24,6 @@ AbstractEglDrmBackend::AbstractEglDrmBackend(DrmBackend *drmBackend, DrmGpu *gpu
|
||||||
connect(m_gpu, &DrmGpu::outputDisabled, this, &AbstractEglDrmBackend::removeOutput);
|
connect(m_gpu, &DrmGpu::outputDisabled, this, &AbstractEglDrmBackend::removeOutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
AbstractEglDrmBackend::~AbstractEglDrmBackend()
|
|
||||||
{
|
|
||||||
cleanup();
|
|
||||||
}
|
|
||||||
|
|
||||||
void AbstractEglDrmBackend::screenGeometryChanged(const QSize &size)
|
void AbstractEglDrmBackend::screenGeometryChanged(const QSize &size)
|
||||||
{
|
{
|
||||||
Q_UNUSED(size)
|
Q_UNUSED(size)
|
||||||
|
|
|
@ -22,8 +22,6 @@ class DrmOutput;
|
||||||
class AbstractEglDrmBackend : public AbstractEglBackend
|
class AbstractEglDrmBackend : public AbstractEglBackend
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
~AbstractEglDrmBackend();
|
|
||||||
|
|
||||||
void screenGeometryChanged(const QSize &size) override;
|
void screenGeometryChanged(const QSize &size) override;
|
||||||
|
|
||||||
virtual int screenCount() const = 0;
|
virtual int screenCount() const = 0;
|
||||||
|
|
|
@ -41,6 +41,11 @@ EglGbmBackend::EglGbmBackend(DrmBackend *drmBackend, DrmGpu *gpu)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EglGbmBackend::~EglGbmBackend()
|
||||||
|
{
|
||||||
|
cleanup();
|
||||||
|
}
|
||||||
|
|
||||||
void EglGbmBackend::cleanupSurfaces()
|
void EglGbmBackend::cleanupSurfaces()
|
||||||
{
|
{
|
||||||
for (auto it = m_outputs.begin(); it != m_outputs.end(); ++it) {
|
for (auto it = m_outputs.begin(); it != m_outputs.end(); ++it) {
|
||||||
|
|
|
@ -38,6 +38,7 @@ class EglGbmBackend : public AbstractEglDrmBackend
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
EglGbmBackend(DrmBackend *drmBackend, DrmGpu *gpu);
|
EglGbmBackend(DrmBackend *drmBackend, DrmGpu *gpu);
|
||||||
|
~EglGbmBackend() override;
|
||||||
|
|
||||||
SceneOpenGLTexturePrivate *createBackendTexture(SceneOpenGLTexture *texture) override;
|
SceneOpenGLTexturePrivate *createBackendTexture(SceneOpenGLTexture *texture) override;
|
||||||
QRegion beginFrame(int screenId) override;
|
QRegion beginFrame(int screenId) override;
|
||||||
|
|
|
@ -75,6 +75,11 @@ EglStreamBackend::EglStreamBackend(DrmBackend *drmBackend, DrmGpu *gpu)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EglStreamBackend::~EglStreamBackend()
|
||||||
|
{
|
||||||
|
cleanup();
|
||||||
|
}
|
||||||
|
|
||||||
void EglStreamBackend::cleanupSurfaces()
|
void EglStreamBackend::cleanupSurfaces()
|
||||||
{
|
{
|
||||||
for (auto it = m_outputs.constBegin(); it != m_outputs.constEnd(); ++it) {
|
for (auto it = m_outputs.constBegin(); it != m_outputs.constEnd(); ++it) {
|
||||||
|
|
|
@ -27,6 +27,7 @@ class EglStreamBackend : public AbstractEglDrmBackend
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
EglStreamBackend(DrmBackend *b, DrmGpu *gpu);
|
EglStreamBackend(DrmBackend *b, DrmGpu *gpu);
|
||||||
|
~EglStreamBackend() override;
|
||||||
SceneOpenGLTexturePrivate *createBackendTexture(SceneOpenGLTexture *texture) override;
|
SceneOpenGLTexturePrivate *createBackendTexture(SceneOpenGLTexture *texture) override;
|
||||||
QRegion beginFrame(int screenId) override;
|
QRegion beginFrame(int screenId) override;
|
||||||
void endFrame(int screenId, const QRegion &damage, const QRegion &damagedRegion) override;
|
void endFrame(int screenId, const QRegion &damage, const QRegion &damagedRegion) override;
|
||||||
|
|
Loading…
Reference in a new issue