]> sigrok.org Git - libsigrok.git/commitdiff
clean up drivers at the end of a session, and fix session file init.
authorBert Vermeulen <redacted>
Sun, 8 Jan 2012 21:05:00 +0000 (22:05 +0100)
committerBert Vermeulen <redacted>
Sun, 8 Jan 2012 21:05:00 +0000 (22:05 +0100)
session.c
session_driver.c

index 9ebaf04f94d91db6b99e2bfa058437413dac8392..ab28c72c2d30d3a091a2887261bac65fba4d496e 100644 (file)
--- 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;
index b6d14eaa1b7895407aa3d30116c67159e9beafa1..05055206665562f7521835dd2026dedbb99b8bc2 100644 (file)
@@ -154,7 +154,6 @@ static void hw_cleanup(void);
  */
 static int hw_init(const char *deviceinfo)
 {
-       hw_cleanup();
 
        sessionfile = g_strdup(deviceinfo);