libeis: drain events before destroying the context

Avoid valgrind complaining about memleaks - disconnecting the clients on the
final unref queues emulated events so let's make sure we get rid of those.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2020-08-07 12:08:53 +10:00
parent 69546a4802
commit 9d18f04e9b

View file

@ -150,6 +150,10 @@ eis_destroy(struct eis *eis)
eis_client_disconnect(c);
}
struct eis_event *e;
while ((e = eis_get_event(eis)) != NULL)
eis_event_unref(e);
eis->logger = logger_unref(eis->logger);
if (eis->backend_interface.destroy)
eis->backend_interface.destroy(eis, eis->backend);