/* * Lib destructor. */ static void tsocks_exit(void) { /* Cleanup every entries in the onion pool. */ onion_pool_destroy(&tsocks_onion_pool); /* Cleanup allocated memory in the config file. */ config_file_destroy(&tsocks_config.conf_file); /* Clean up logging. */ log_destroy(); }
/* * Cleanup torsocks library memory and open fd. */ void tsocks_cleanup(void) { if (tsocks_cleaned_up) { return; } /* Cleanup every entries in the onion pool. */ onion_pool_destroy(&tsocks_onion_pool); /* Cleanup allocated memory in the config file. */ config_file_destroy(&tsocks_config.conf_file); /* Clean up logging. */ log_destroy(); tsocks_cleaned_up = 1; }