From ea81b49a3ca4fff4994693d30045d51b86181e32 Mon Sep 17 00:00:00 2001 From: Bert Vermeulen Date: Wed, 11 Dec 2013 18:31:56 +0100 Subject: Load decoders from all search paths, not just the default. srd_decoder_load_all() was really only getting a list of decoders from the default (installation) path, so could not find uninstalled decoders, or those in a custom added search path. This broke development of new PDs when using the SIGROKDECODE_DIR environment variable, and broke many of the unit tests in the tests/ directory -- those actually tested against the already-installed decoders, not the ones about to be installed. --- srd.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'srd.c') diff --git a/srd.c b/srd.c index 76e1b34..a6c16f6 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; @@ -194,6 +197,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 +262,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; } -- cgit v1.2.3-70-g09d2