From: Lars-Peter Clausen Date: Thu, 5 Jul 2012 19:15:08 +0000 (+0200) Subject: sr: session: Do not cleanup the driver state in sr_session_stop() X-Git-Tag: dsupstream~866 X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=9213ad012accac3dbfbc6b72d6e99228e87740a4 sr: session: Do not cleanup the driver state in sr_session_stop() 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 --- diff --git a/session.c b/session.c index 0cd4e200..07a21cf5 100644 --- 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(); } }