]> sigrok.org Git - libsigrok.git/commitdiff
sr: session: Do not cleanup the driver state in sr_session_stop()
authorLars-Peter Clausen <redacted>
Thu, 5 Jul 2012 19:15:08 +0000 (21:15 +0200)
committerBert Vermeulen <redacted>
Wed, 11 Jul 2012 21:28:35 +0000 (23:28 +0200)
By cleaning up the driver state all devices will become inaccessible, which
means that is neither possible to query any information from it (like sample
rate) and it is also not possible to restart data acquisition.

sr_session_save() tries to query the sample rate from the device, as a result
calling sr_session_save() after calling sr_session_stop() - which is for example
done by sigrok-cli - will cause a segfault. This patch resolves the issue.

Signed-off-by: Lars-Peter Clausen <redacted>
session.c

index 0cd4e2000387c8591900e9495a3cc6d1700802e9..07a21cf59c1b0ac7415f4e8dbee0cc088530ed4a 100644 (file)
--- a/session.c
+++ b/session.c
@@ -366,8 +366,6 @@ SR_API int sr_session_stop(void)
                if (dev->driver) {
                        if (dev->driver->dev_acquisition_stop)
                                dev->driver->dev_acquisition_stop(dev->driver_index, dev);
-                       if (dev->driver->cleanup)
-                               dev->driver->cleanup();
                }
        }