]> sigrok.org Git - libsigrok.git/commit - session.c
session.c: Remove all remaining sources on sr_session_stop
authorAlexandru Gagniuc <redacted>
Wed, 19 Dec 2012 10:15:18 +0000 (04:15 -0600)
committerBert Vermeulen <redacted>
Mon, 24 Dec 2012 19:24:13 +0000 (20:24 +0100)
commitf1f7e62d6df766f4a65d7854ae2dd745c623c863
tree9ed7efa6dcb905ea988372ea0332eacbb576389d
parentdc890b8f9fa01895d3849e7d5ab8be1146f07b9e
session.c: Remove all remaining sources on sr_session_stop

Some sources may not be necessarily associated with a device. The best example
is the anykey pollfd from sigrok-cli. sr_session_stop only removes sources
associated with hardware devices via dev_acquisition_stop. Sources such as
anykey are not removed, and thus session->num_sources will not get to 0. As a
result, we may get into situations where the event loop enters an infinite
state.

To prevent this, all we have to do is remove any active sources that are still
present after dev_acquisition_stop has been called for all devices.

This fixes bug 14.
session.c