Add a check for waylandServer in the dtor before using it

Make sure the waylandServer ptr exists before referencing it
in the dtor.

REVIEW: 126190
This commit is contained in:
Rohan Garg 2015-11-30 15:57:22 +01:00
parent f96f4a9fd1
commit 8680586dbd

View file

@ -75,6 +75,10 @@ ApplicationWayland::ApplicationWayland(int &argc, char **argv)
ApplicationWayland::~ApplicationWayland() ApplicationWayland::~ApplicationWayland()
{ {
if (!waylandServer()) {
return;
}
waylandServer()->backend()->setOutputsEnabled(false); waylandServer()->backend()->setOutputsEnabled(false);
destroyWorkspace(); destroyWorkspace();
waylandServer()->dispatch(); waylandServer()->dispatch();