/** * Shutdown libsigrokdecode. * * This frees all the memory allocated for protocol decoders and shuts down * the Python interpreter. * * This function should only be called if there was a (successful!) invocation * of srd_init() before. Calling this function multiple times in a row, without * any successful srd_init() calls in between, is not allowed. * * @return SRD_OK upon success, a (negative) error code otherwise. */ SRD_API int srd_exit(void) { srd_dbg("Exiting libsigrokdecode."); srd_decoder_unload_all(); g_slist_free(pd_list); pd_list = NULL; /* Py_Finalize() returns void, any finalization errors are ignored. */ Py_Finalize(); return SRD_OK; }
/** * Shutdown libsigrokdecode. * * This frees all the memory allocated for protocol decoders and shuts down * the Python interpreter. * * This function should only be called if there was a (successful!) invocation * of srd_init() before. Calling this function multiple times in a row, without * any successful srd_init() calls in between, is not allowed. * * @return SRD_OK upon success, a (negative) error code otherwise. * * @since 0.1.0 */ SRD_API int srd_exit(void) { srd_dbg("Exiting libsigrokdecode."); g_slist_foreach(sessions, (GFunc)srd_session_destroy, NULL); srd_decoder_unload_all(); g_slist_free_full(searchpaths, g_free); searchpaths = NULL; /* Py_Finalize() returns void, any finalization errors are ignored. */ Py_Finalize(); max_session_id = -1; return SRD_OK; }
/** * Shutdown libsigrokdecode. * * This frees all the memory allocated for protocol decoders and shuts down * the Python interpreter. * * This function should only be called if there was a (successful!) invocation * of srd_init() before. Calling this function multiple times in a row, without * any successful srd_init() calls in between, is not allowed. * * @return SRD_OK upon success, a (negative) error code otherwise. * * @since 0.1.0 */ SRD_API int srd_exit(void) { GSList *l; srd_dbg("Exiting libsigrokdecode."); for (l = sessions; l; l = l->next) srd_session_destroy((struct srd_session *)l->data); srd_decoder_unload_all(); g_slist_free(pd_list); pd_list = NULL; /* Py_Finalize() returns void, any finalization errors are ignored. */ Py_Finalize(); max_session_id = -1; return SRD_OK; }