diff options
| author | Pekka Paalanen <ppaalanen@gmail.com> | 2011-11-09 16:27:07 +0200 |
|---|---|---|
| committer | Pekka Paalanen <ppaalanen@gmail.com> | 2011-11-29 14:46:49 +0200 |
| commit | 804d5dd348567fd286b8aa5101d3aff95ecd69d7 (patch) | |
| tree | 3ada249040f8acf89bea00fe60b03c7182cca149 /src/wayland-util.c | |
| parent | server: no errors to a dead client (diff) | |
| download | wayland-804d5dd348567fd286b8aa5101d3aff95ecd69d7.tar wayland-804d5dd348567fd286b8aa5101d3aff95ecd69d7.tar.gz wayland-804d5dd348567fd286b8aa5101d3aff95ecd69d7.tar.bz2 wayland-804d5dd348567fd286b8aa5101d3aff95ecd69d7.tar.lz wayland-804d5dd348567fd286b8aa5101d3aff95ecd69d7.tar.xz wayland-804d5dd348567fd286b8aa5101d3aff95ecd69d7.tar.zst wayland-804d5dd348567fd286b8aa5101d3aff95ecd69d7.zip | |
util: clear pointers on wl_list_remove()
Set the next and prev pointers of the removed list element to NULL. This
will catch programming errors that would use invalid list pointers,
double-remove for instance.
It also helps debugging, making it easy to see in gdb if an object is
not in a list.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Diffstat (limited to 'src/wayland-util.c')
| -rw-r--r-- | src/wayland-util.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/wayland-util.c b/src/wayland-util.c index 647b861..06bd245 100644 --- a/src/wayland-util.c +++ b/src/wayland-util.c @@ -49,6 +49,8 @@ wl_list_remove(struct wl_list *elm) { elm->prev->next = elm->next; elm->next->prev = elm->prev; + elm->next = NULL; + elm->prev = NULL; } WL_EXPORT int |
