X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=srd.c;h=5903c6d7e75b748149218ffa459323f5d8ae804b;hp=e040e3aac87fbcf71e0f7f8bd97bb10478bb6e6c;hb=43047b89962667436f6ed11c5da5e6f4a1ccfbde;hpb=7969d8035530d40753c4f880c90a4e90f9679ccc diff --git a/srd.c b/srd.c index e040e3a..5903c6d 100644 --- a/srd.c +++ b/srd.c @@ -188,11 +188,6 @@ err: return SRD_ERR_PYTHON; } -SRD_API GSList *srd_searchpaths_get(void) -{ - return g_slist_copy_deep(searchpaths, (GCopyFunc)g_strdup, NULL); -} - /** * Initialize libsigrokdecode. * @@ -312,7 +307,8 @@ SRD_API int srd_exit(void) { srd_dbg("Exiting libsigrokdecode."); - g_slist_foreach(sessions, (GFunc)srd_session_destroy, NULL); + for (GSList *l = sessions; l; l = l->next) + srd_session_destroy(l->data); srd_decoder_unload_all(); g_slist_free_full(searchpaths, g_free); @@ -391,4 +387,16 @@ err: return SRD_ERR_PYTHON; } +/** + * Return the list of protocol decoder search paths. + * + * @return The list of search paths used when loading protocol decoders. + * + * @since 0.5.1 + */ +SRD_API GSList *srd_searchpaths_get(void) +{ + return g_slist_copy_deep(searchpaths, (GCopyFunc)g_strdup, NULL); +} + /** @} */