shm: add safety assertions
authorSimon Ser <contact@emersion.fr>
Wed, 2 Jun 2021 14:35:30 +0000 (16:35 +0200)
committerSimon Ser <contact@emersion.fr>
Tue, 29 Jun 2021 09:17:44 +0000 (11:17 +0200)
commit817fdb9009cd085a6e8b00a5fab207050cae5b1a
tree53c95db1e88c7f125d5f89bff503d05a679e56db
parentccc9612e823601f9bb7675bf2b029fd6eed6ed7b
shm: add safety assertions

Catch any API mis-use with an assert. This should abort when the
user calls unreferences the pool more times than it's referenced.

Also change the refcount check to explicitly check for positive
counts. That makes the condition more readable.

Signed-off-by: Simon Ser <contact@emersion.fr>
src/wayland-shm.c