X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=srd.c;h=f5b885fecc8008ffdab72b81c92407e878a7058c;hp=76e1b348fd62e403cf660c35c6f3b13aad93e27c;hb=cddd11bc7911af991fcd7f9a4232c700fded9c17;hpb=820bf44828745e7d0a7bb0974164acd899c3c113 diff --git a/srd.c b/srd.c index 76e1b34..f5b885f 100644 --- a/srd.c +++ b/srd.c @@ -25,6 +25,9 @@ /** @cond PRIVATE */ +/* Python module search paths */ +SRD_PRIV GSList *searchpaths = NULL; + /* session.c */ extern GSList *sessions; extern int max_session_id; @@ -32,9 +35,6 @@ extern int max_session_id; /* decoder.c */ extern SRD_PRIV GSList *pd_list; -/* module_sigrokdecode.c */ -extern PyMODINIT_FUNC PyInit_sigrokdecode(void); - /** @endcond */ /** @@ -194,6 +194,8 @@ SRD_API int srd_exit(void) srd_session_destroy((struct srd_session *)l->data); srd_decoder_unload_all(); + g_slist_free_full(searchpaths, g_free); + searchpaths = NULL; /* Py_Finalize() returns void, any finalization errors are ignored. */ Py_Finalize(); @@ -257,6 +259,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; }