]> sigrok.org Git - libsigrok.git/commitdiff
sr: session_driver: Remove source on completion
authorLars-Peter Clausen <redacted>
Sun, 2 Sep 2012 17:02:42 +0000 (19:02 +0200)
committerBert Vermeulen <redacted>
Sun, 2 Sep 2012 17:17:57 +0000 (19:17 +0200)
Remove the session source once we are done loading the file, otherwise we'll
spin forever in sr_session_run.

Reported-by: Joel Holdsworth <redacted>
Signed-off-by: Lars-Peter Clausen <redacted>
session_driver.c

index 9f87c8e058f5f040ec87c4c26b3dda98eddad2a7..6ba804285b5d0ff8b2815c062cb879a823baad74 100644 (file)
@@ -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;
 }