summaryrefslogtreecommitdiff
path: root/src/compositor.c
diff options
context:
space:
mode:
authorRob Bradford <rob@linux.intel.com>2012-01-05 15:30:00 +0000
committerKristian Høgsberg <krh@bitplanet.net>2012-01-05 10:59:44 -0500
commit0b17b8ec01116f64edb42d9864b2283022b342cf (patch)
treeb0f5634f368c9ecdd78db6b5d120c69db9799644 /src/compositor.c
parentb07876d23a929faa5c61d9180810fedc0fcaeb51 (diff)
compositor: Don't try and destroy old pointer surface if it empty
If attach was called on wl_input_device with a nil buffer twice then the second call would cause a segfault.
Diffstat (limited to 'src/compositor.c')
-rw-r--r--src/compositor.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/compositor.c b/src/compositor.c
index 819cb5d9..26279872 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -1609,8 +1609,10 @@ input_device_attach(struct wl_client *client,
weston_surface_damage_below(device->sprite);
if (!buffer_resource) {
- destroy_surface(&device->sprite->surface.resource);
- device->sprite = NULL;
+ if (device->sprite) {
+ destroy_surface(&device->sprite->surface.resource);
+ device->sprite = NULL;
+ }
return;
}