From: Hubert CHAUMETTE Date: Fri, 31 Jul 2015 07:44:09 +0000 (+0200) Subject: libsigrok: demo: close pipes on dev_acquisition_stop() X-Git-Tag: libsigrok-0.4.0~454 X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=6c7d80afcaf043eb8128a3102519032850fec1af libsigrok: demo: close pipes on dev_acquisition_stop() Fixes a bug where new acquisition failes due to leftover pipes from previous acquisitions: sr: demo: dev_acquisition_start: pipe() failed Indeed, PulseView had 2024 pipes opened. With this fix, it stabilizes at 33 with sampling thread active. Signed-off-by: Hubert CHAUMETTE --- diff --git a/src/hardware/demo/demo.c b/src/hardware/demo/demo.c index 4ad4ea34..920c1e4d 100644 --- a/src/hardware/demo/demo.c +++ b/src/hardware/demo/demo.c @@ -901,6 +901,8 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data) g_io_channel_shutdown(devc->channel, FALSE, NULL); g_io_channel_unref(devc->channel); devc->channel = NULL; + close(devc->pipe_fds[0]); + close(devc->pipe_fds[1]); /* Send last packet. */ packet.type = SR_DF_END;