Avoid hypothetical crash if output->init fails

Summary:
con->setOutput and crtc->setOutput  is called in Output::~Output so this
is doing it twice redundantly.

More importantly Output::~Output calls crtc->blank(), which means we
need a valid CRTC object there.

Test Plan: Compiles

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: bshah, plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D8779
This commit is contained in:
David Edmundson 2017-11-15 16:07:59 +00:00
parent 48f7331c4c
commit 6325749f21

View file

@ -455,8 +455,6 @@ void DrmBackend::updateOutputs()
if (!output->init(connector.data())) {
qCWarning(KWIN_DRM) << "Failed to create output for connector " << con->id();
con->setOutput(nullptr);
crtc->setOutput(nullptr);
delete output;
continue;
}