test: drain all events before exiting

We don't want valgrind to complain about leaks when we only handle a portion
of the events on the socket.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2020-08-07 11:37:17 +10:00
parent 1c5d6c1e2b
commit e6b410a56a

View file

@ -50,6 +50,11 @@ struct peck {
static void
peck_destroy(struct peck *peck)
{
/* we don't want valgrind to complain about us not handling *all*
* events in a test */
peck_drain_ei(peck->ei);
peck_drain_eis(peck->eis);
ei_unref(peck->ei);
eis_unref(peck->eis);
logger_unref(peck->logger);