Skip to content

Commit

Permalink
[wayland] Fix crash when pinging a surface with an invalid resource. …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
denexter committed Feb 24, 2016
1 parent 0579c7f commit a78ed55
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 a78ed55

Please sign in to comment.