Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'jb34185' into 'mer-5.4'
[wayland] Fix crash when pinging a surface with an invalid resource. Fixes JB#34185

Check the surface hasn't been deleted before initiating the ping so
that an invalid resource isn't dereferenced when printing a warning
after the operation inevitably fails.

Change-Id: I205def680971e50e59d761f16128cd4019234037

See merge request !3
  • Loading branch information
rainemak committed Feb 25, 2016
2 parents 0579c7f + a78ed55 commit 9dad99f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/compositor/compositor_api/qwaylandsurface.cpp
Expand Up @@ -280,6 +280,10 @@ bool QWaylandSurface::sendInterfaceOp(QWaylandSurfaceOp &op)
void QWaylandSurface::ping()
{
Q_D(QWaylandSurface);

if (d->isDestroyed())
return;

uint32_t serial = wl_display_next_serial(compositor()->waylandDisplay());
QWaylandSurfacePingOp op(serial);
if (!sendInterfaceOp(op)) {
Expand Down

0 comments on commit 9dad99f

Please sign in to comment.