From 4833729d1d5efe8e86f19fe21a6077a7b963b223 Mon Sep 17 00:00:00 2001 From: AlexandraTrifan Date: Fri, 23 Feb 2024 09:53:47 +0200 Subject: [PATCH] m2kplugin: Close all libm2k contexts when disconnecting the M2K from Scopy. This change is needed for proper compatibility with libm2k v0.8.0 which introduced the concept of reference count for all open contexts together with handling context ownership (iio_context created outside libm2k or by libm2k). For libm2k to cleanup all the context refs, every m2kOpen call should be matched by a closeContext call. Signed-off-by: AlexandraTrifan --- plugins/m2k/src/m2kcontroller.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/m2k/src/m2kcontroller.cpp b/plugins/m2k/src/m2kcontroller.cpp index bed37eb007..d9c7add820 100644 --- a/plugins/m2k/src/m2kcontroller.cpp +++ b/plugins/m2k/src/m2kcontroller.cpp @@ -78,7 +78,7 @@ void M2kController::disconnectM2k() if(identifyTask && identifyTask->isRunning()) { identifyTask->requestInterruption(); } - contextClose(m_m2k, true); + contextCloseAll(); } catch(std::exception &ex) { qDebug(CAT_M2KPLUGIN) << ex.what(); }