Remove the session source once we are done loading the file, otherwise we'll
spin forever in sr_session_run.

Reported-by: Joel Holdsworth <[email protected]>
Signed-off-by: Lars-Peter Clausen <[email protected]>
---
 libsigrok/session_driver.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/libsigrok/session_driver.c b/libsigrok/session_driver.c
index 9f87c8e..6ba8042 100644
--- a/libsigrok/session_driver.c
+++ b/libsigrok/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;
 }
 
-- 
1.7.2.5


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
sigrok-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to