From: Bert Vermeulen Date: Sun, 8 Jan 2012 21:05:00 +0000 (+0100) Subject: clean up drivers at the end of a session, and fix session file init. X-Git-Tag: libsigrok-0.1.0~178 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=8c76be539e8098c08f69f56053077211001ed52b;p=libsigrok.git clean up drivers at the end of a session, and fix session file init. --- diff --git a/session.c b/session.c index 9ebaf04f..ab28c72c 100644 --- a/session.c +++ b/session.c @@ -378,8 +378,12 @@ int sr_session_stop(void) for (l = session->devices; l; l = l->next) { device = l->data; /* Check for device != NULL. */ - if (device->plugin && device->plugin->stop_acquisition) - device->plugin->stop_acquisition(device->plugin_index, device); + if (device->plugin) { + if (device->plugin->stop_acquisition) + device->plugin->stop_acquisition(device->plugin_index, device); + if (device->plugin->cleanup) + device->plugin->cleanup(); + } } return SR_OK; diff --git a/session_driver.c b/session_driver.c index b6d14eaa..05055206 100644 --- a/session_driver.c +++ b/session_driver.c @@ -154,7 +154,6 @@ static void hw_cleanup(void); */ static int hw_init(const char *deviceinfo) { - hw_cleanup(); sessionfile = g_strdup(deviceinfo);