clean up drivers at the end of a session, and fix session file init.

This commit is contained in:
Bert Vermeulen 2012-01-08 22:05:00 +01:00
parent e0508e6799
commit 8c76be539e
2 changed files with 6 additions and 3 deletions

View File

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

View File

@ -154,7 +154,6 @@ static void hw_cleanup(void);
*/
static int hw_init(const char *deviceinfo)
{
hw_cleanup();
sessionfile = g_strdup(deviceinfo);