X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=session.c;h=0c379c50259fc3802564377107fc02cd5c9bb454;hb=c2fa697afa86a8e6f37bef13acb5b8532714274e;hp=2ea7dbef29e50fcc64ab2c9876f2f62e8767e0de;hpb=efdecf4c0553ce00ea2a6365212f5fe305496fed;p=libsigrok.git diff --git a/session.c b/session.c index 2ea7dbef..0c379c50 100644 --- a/session.c +++ b/session.c @@ -131,7 +131,7 @@ SR_API int sr_session_dev_remove_all(void) return SR_ERR_BUG; } - g_slist_free_full(session->devs, (GDestroyNotify)sr_dev_close); + g_slist_free(session->devs); session->devs = NULL; return SR_OK; @@ -260,8 +260,11 @@ static int sr_session_run_poll(void) * just once per main event loop. */ g_mutex_lock(&session->stop_mutex); - if (session->abort_session) + if (session->abort_session) { sr_session_stop_sync(); + /* But once is enough. */ + session->abort_session = FALSE; + } g_mutex_unlock(&session->stop_mutex); } } @@ -377,15 +380,6 @@ SR_PRIV int sr_session_stop_sync(void) } } - /* - * Some sources may not be necessarily associated with a device. - * Those sources may still be present even after stopping all devices. - * We need to make sure all sources are removed, or we risk running the - * session in an infinite loop. - */ - while (session->num_sources) - sr_session_source_remove(session->sources[0].poll_object); - return SR_OK; }