summaryrefslogtreecommitdiffstats
path: root/src/compositor/compositor_api
diff options
context:
space:
mode:
authorAndy Nichols <andy.nichols@nokia.com>2012-06-05 15:41:59 +0200
committerJørgen Lind <jorgen.lind@nokia.com>2012-06-06 10:14:10 +0200
commit077067bc8f68a3146430b941ea0f0daa61781f91 (patch)
tree46502496fab3f8949f3c73e7e6af8df734d3c532 /src/compositor/compositor_api
parent123efe5eb255cf0e2408dff3022cf3e0115a11e7 (diff)
A few fixes to prevent compositor crashes
If a client application exits abruptly while in direct rendering mode, the surface buffer could reference a null buffer. We now check for this before attempting to use such a surface buffer. It is also possible for WaylandSurfaceNode::preprocess to be called after WaylandSurfaceItem has called surfaceDestroyed, so now we check for a valid surface in preprocess as well. Change-Id: Ibca71349b7a24687944f8b6cd505941b580e0c2a Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com> Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Diffstat (limited to 'src/compositor/compositor_api')
-rw-r--r--src/compositor/compositor_api/waylandsurfacenode.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/compositor/compositor_api/waylandsurfacenode.cpp b/src/compositor/compositor_api/waylandsurfacenode.cpp
index e6571751c..a4063ccb4 100644
--- a/src/compositor/compositor_api/waylandsurfacenode.cpp
+++ b/src/compositor/compositor_api/waylandsurfacenode.cpp
@@ -39,10 +39,12 @@ void WaylandSurfaceNode::preprocess()
{
QMutexLocker locker(WaylandSurfaceItem::mutex);
- //Update if the item is dirty and we haven't done an updateTexture for this frame
- if (m_item && m_item->m_damaged && !m_textureUpdated) {
- m_item->updateTexture();
- updateTexture();
+ if (m_item && m_item->surface()) {
+ //Update if the item is dirty and we haven't done an updateTexture for this frame
+ if (m_item->m_damaged && !m_textureUpdated) {
+ m_item->updateTexture();
+ updateTexture();
+ }
}
//Reset value for next frame: we have not done updatePaintNode yet
m_textureUpdated = false;