X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=srd.c;h=61280ef41d7f4f838472aa2f9ff98ec672305520;hp=07d79523ae859dd3d8de5d5e7d71ce0455dcf220;hb=f6527cc4f7625eb5283eee5392312ad5df70e0f3;hpb=190b71cfebc1dd000d3203c7300a10afd96c1201 diff --git a/srd.c b/srd.c index 07d7952..61280ef 100644 --- a/srd.c +++ b/srd.c @@ -25,16 +25,13 @@ /** @cond PRIVATE */ +/* Python module search paths */ +SRD_PRIV GSList *searchpaths = NULL; + /* session.c */ extern GSList *sessions; extern int max_session_id; -/* decoder.c */ -extern SRD_PRIV GSList *pd_list; - -/* module_sigrokdecode.c */ -extern PyMODINIT_FUNC PyInit_sigrokdecode(void); - /** @endcond */ /** @@ -194,8 +191,8 @@ SRD_API int srd_exit(void) srd_session_destroy((struct srd_session *)l->data); srd_decoder_unload_all(); - g_slist_free(pd_list); - pd_list = NULL; + g_slist_free_full(searchpaths, g_free); + searchpaths = NULL; /* Py_Finalize() returns void, any finalization errors are ignored. */ Py_Finalize(); @@ -259,6 +256,7 @@ SRD_PRIV int srd_decoder_searchpath_add(const char *path) PySys_SetPath(wc_new_path); g_string_free(new_path, TRUE); g_free(wc_new_path); + searchpaths = g_slist_append(searchpaths, g_strdup(path)); return SRD_OK; }