LIBPROTO(__UserLibCleanup, void, REG(a6, UNUSED __BASE_OR_IFACE), REG(a0, struct LibraryHeader *libBase)) { TRACELINE(); // we call OPENSSL_cleanup to clean everything for the // current instance. OPENSSL_cleanup(); if(libBase->parent->thread_hash) { D(DBF_STARTUP, "Performing unfreed states cleanup for %08lx (group %lu)", FindTask(NULL), libBase->ThreadGroupID); ObtainSemaphore(&libBase->parent->openssl_cs); D(DBF_STARTUP, "h_doall(thread_hash)"); h_doall(libBase->parent->thread_hash, (void (*)(long, void *))ThreadGroupStateCleanup); ReleaseSemaphore(&libBase->parent->openssl_cs); } else W(DBF_STARTUP, "No thread_hash"); #if defined(__amigaos4__) if(IUtility != NULL) { DropInterface((struct Interface *)IUtility); IUtility = NULL; } if(IIntuition != NULL) { DropInterface((struct Interface *)IIntuition); IIntuition = NULL; } if(IDOS != NULL) { DropInterface((struct Interface *)IDOS); IDOS = NULL; } #endif if(UtilityBase != NULL) { CloseLibrary((struct Library *)UtilityBase); UtilityBase = NULL; } if(IntuitionBase != NULL) { CloseLibrary((struct Library *)IntuitionBase); IntuitionBase = NULL; } if(DOSBase != NULL) { CloseLibrary((struct Library *)DOSBase); DOSBase = NULL; } // make sure to free all resources of libcmt __free_libcmt(); }
void tls_deinit(void) { if (tls_initialised) { tls_compat_cleanup(); tls_config_free(tls_config_default); tls_config_default = NULL; #ifdef USE_LIBSSL_INTERNALS EVP_cleanup(); CRYPTO_cleanup_all_ex_data(); BIO_sock_cleanup(); ERR_clear_error(); ERR_remove_thread_state(NULL); ERR_free_strings(); #else OPENSSL_cleanup(); #endif tls_initialised = 0; } }
static int win32atexit(void) { OPENSSL_cleanup(); return 0; }