From 8c76be539e8098c08f69f56053077211001ed52b Mon Sep 17 00:00:00 2001 From: Bert Vermeulen Date: Sun, 8 Jan 2012 22:05:00 +0100 Subject: [PATCH] clean up drivers at the end of a session, and fix session file init. --- session.c | 8 ++++++-- session_driver.c | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) 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);