From: Lars-Peter Clausen Date: Sun, 2 Sep 2012 17:02:42 +0000 (+0200) Subject: sr: session_driver: Remove source on completion X-Git-Tag: dsupstream~709 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=b863fb1b9d486867ab1fc5e0f62fb42321080b5a;p=libsigrok.git sr: session_driver: Remove source on completion Remove the session source once we are done loading the file, otherwise we'll spin forever in sr_session_run. Reported-by: Joel Holdsworth Signed-off-by: Lars-Peter Clausen --- diff --git a/session_driver.c b/session_driver.c index 9f87c8e0..6ba80428 100644 --- a/session_driver.c +++ b/session_driver.c @@ -98,6 +98,7 @@ static int receive_data(int fd, int revents, void *cb_data) if (!got_data) { packet.type = SR_DF_END; sr_session_send(cb_data, &packet); + sr_session_source_remove(-1); } return TRUE; @@ -121,8 +122,6 @@ static int hw_cleanup(void) g_slist_free(dev_insts); dev_insts = NULL; - sr_session_source_remove(-1); - return SR_OK; }