diff options
author | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2015-10-28 10:20:26 +0100 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2015-11-04 09:17:54 +0000 |
commit | 534b09c2aa343ddec340863be1036938d45e9769 (patch) | |
tree | 50f43277b6b79eb88b87b15ce599169d8e343961 | |
parent | 9dbf4f6b11b694c8bf5112a351aaf7a257aabba9 (diff) |
Null pointer check for example
The documentation says that defaultOutput() is initialized later.
Change-Id: I3dcc6c9dc7395c7986721235333388614928347c
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
-rw-r--r-- | examples/wayland/qwindow-compositor/windowcompositor.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/examples/wayland/qwindow-compositor/windowcompositor.cpp b/examples/wayland/qwindow-compositor/windowcompositor.cpp index b55975623..24a0e0f52 100644 --- a/examples/wayland/qwindow-compositor/windowcompositor.cpp +++ b/examples/wayland/qwindow-compositor/windowcompositor.cpp @@ -198,12 +198,16 @@ void WindowCompositor::triggerRender() void WindowCompositor::startRender() { - defaultOutput()->frameStarted(); + QWaylandOutput *out = defaultOutput(); + if (out) + out->frameStarted(); } void WindowCompositor::endRender() { - defaultOutput()->sendFrameCallbacks(); + QWaylandOutput *out = defaultOutput(); + if (out) + out->sendFrameCallbacks(); } void WindowCompositor::updateCursor() |