]> sigrok.org Git - libsigrok.git/blobdiff - session.c
better cleanup of device/plugin resources
[libsigrok.git] / session.c
index 6e597ab34dd87065a0fc3bd23e16d2b4c45abb11..632ac9467763a5d3dbe042a00fa1a579a225c1d9 100644 (file)
--- a/session.c
+++ b/session.c
@@ -54,6 +54,7 @@ struct sr_session *sr_session_new(void)
 
 void sr_session_destroy(void)
 {
+
        g_slist_free(session->devices);
 
        /* TODO: Loop over protocol decoders and free them. */
@@ -71,8 +72,8 @@ int sr_session_device_add(struct sr_device *device)
 {
        int ret;
 
-       if (device->plugin && device->plugin->open) {
-               ret = device->plugin->open(device->plugin_index);
+       if (device->plugin && device->plugin->opendev) {
+               ret = device->plugin->opendev(device->plugin_index);
                if (ret != SR_OK)
                        return ret;
        }