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);