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 <joel@airwebreathe.org.uk>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
Lars-Peter Clausen 2012-09-02 19:02:42 +02:00 committed by Bert Vermeulen
parent 40578aa487
commit b863fb1b9d
1 changed files with 1 additions and 2 deletions

View 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;
}