diff options
| author | Kristian Høgsberg <krh@bitplanet.net> | 2012-06-18 12:09:47 -0400 |
|---|---|---|
| committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-06-18 12:09:47 -0400 |
| commit | c806dde7e61f4d06564bd3acf74dbba6cfa328c6 (patch) | |
| tree | 08142262a8c0f6aee3235bd367f06e0d5a76816d /src/data-device.c | |
| parent | tests: Update test cases to new closure allocate convention (diff) | |
| download | wayland-c806dde7e61f4d06564bd3acf74dbba6cfa328c6.tar wayland-c806dde7e61f4d06564bd3acf74dbba6cfa328c6.tar.gz wayland-c806dde7e61f4d06564bd3acf74dbba6cfa328c6.tar.bz2 wayland-c806dde7e61f4d06564bd3acf74dbba6cfa328c6.tar.lz wayland-c806dde7e61f4d06564bd3acf74dbba6cfa328c6.tar.xz wayland-c806dde7e61f4d06564bd3acf74dbba6cfa328c6.tar.zst wayland-c806dde7e61f4d06564bd3acf74dbba6cfa328c6.zip | |
data-device: Fix list corruption when the source goes away
If the data source is destroyed, the corresponding offers may stay around for
a little longer (until the owning client destroys it). When the offer is
finally destroyed, we have to be careful to only remove the source
destroy listener if the source hasn't yet been destroyed.
Thanks to Martin Minarik for tracking down where the corruption happened.
Diffstat (limited to 'src/data-device.c')
| -rw-r--r-- | src/data-device.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/data-device.c b/src/data-device.c index a4bfa68..67ae41f 100644 --- a/src/data-device.c +++ b/src/data-device.c @@ -70,7 +70,8 @@ destroy_data_offer(struct wl_resource *resource) { struct wl_data_offer *offer = resource->data; - wl_list_remove(&offer->source_destroy_listener.link); + if (offer->source) + wl_list_remove(&offer->source_destroy_listener.link); free(offer); } |
