summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorKarl Palsson <karlp@etactica.com>2016-04-11 17:25:42 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2017-02-20 16:28:27 +0100
commit3262ef0203e23399f3cab796391da06969c8306b (patch)
tree98a46c8eff87242c8cc89870e5008a116d5d23e0 /session.c
parent1d4fe1c19c0948fb67b4a91495b126a763ea7adb (diff)
downloadlibsigrokdecode-3262ef0203e23399f3cab796391da06969c8306b.tar.gz
libsigrokdecode-3262ef0203e23399f3cab796391da06969c8306b.zip
Support adding multiple instances of a decoder
srd_inst_new() used the decoder ID as the instance ID, preventing the use of multiple instances of the same decoder in the same session. Simply append a numerical suffix to later instances to allow more. Required changes to cleanup to reliably free all memory. Valgrind checked. This fixes parts of bug #868. Based on original work by: Soeren Apel <soeren@apelpie.net> Signed-off-by: Karl Palsson <karlp@etactica.com>
Diffstat (limited to 'session.c')
-rw-r--r--session.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/session.c b/session.c
index e1bb4f9..6a7628e 100644
--- a/session.c
+++ b/session.c
@@ -278,7 +278,7 @@ SRD_API int srd_session_destroy(struct srd_session *sess)
session_id = sess->session_id;
if (sess->di_list)
- srd_inst_free_all(sess, NULL);
+ srd_inst_free_all(sess);
if (sess->callbacks)
g_slist_free_full(sess->callbacks, g_free);
sessions = g_slist_remove(sessions, sess);