Improve sanity check in WaylandBackend::create

If the WaylandBackend got created without a wl_display we better
stop processing.
This commit is contained in:
Martin Gräßlin 2014-08-12 09:46:39 +02:00
parent 670973efdb
commit f373aa1ce5

View file

@ -726,6 +726,11 @@ WaylandBackend *WaylandBackend::create(QObject *parent)
return NULL; return NULL;
} }
s_self = new WaylandBackend(parent); s_self = new WaylandBackend(parent);
// check whether it has a display
if (!s_self->display()) {
delete s_self;
s_self = nullptr;
}
return s_self; return s_self;
} }