diff --git a/backends/drm/drm_backend.cpp b/backends/drm/drm_backend.cpp
index c003c9b892..2a4969a6d3 100644
--- a/backends/drm/drm_backend.cpp
+++ b/backends/drm/drm_backend.cpp
@@ -520,6 +520,7 @@ DrmOutput::~DrmOutput()
{
hideCursor();
cleanupBlackBuffer();
+ delete m_waylandOutput.data();
}
void DrmOutput::hideCursor()
@@ -608,7 +609,11 @@ void DrmOutput::init(drmModeConnector *connector)
initEdid(connector);
m_savedCrtc.reset(drmModeGetCrtc(m_backend->fd(), m_crtcId));
blank();
- m_waylandOutput.reset(waylandServer()->display()->createOutput());
+ if (!m_waylandOutput.isNull()) {
+ delete m_waylandOutput.data();
+ m_waylandOutput.clear();
+ }
+ m_waylandOutput = waylandServer()->display()->createOutput();
if (!m_edid.eisaId.isEmpty()) {
m_waylandOutput->setManufacturer(QString::fromLatin1(m_edid.eisaId));
} else {
diff --git a/backends/drm/drm_backend.h b/backends/drm/drm_backend.h
index e24b7bff7c..277d9ebb92 100644
--- a/backends/drm/drm_backend.h
+++ b/backends/drm/drm_backend.h
@@ -22,6 +22,7 @@ along with this program. If not, see .
#include "abstract_backend.h"
#include
+#include
#include
#include
@@ -155,7 +156,7 @@ private:
};
Edid m_edid;
QScopedPointer<_drmModeCrtc, CrtcCleanup> m_savedCrtc;
- QScopedPointer m_waylandOutput;
+ QPointer m_waylandOutput;
};
class DrmBuffer