Exemplo n.º 1
0
YR_API int yr_finalize(void)
{
  #if defined HAVE_LIBCRYPTO && OPENSSL_VERSION_NUMBER < 0x10100000L
  int i;
  #endif

  // yr_finalize shouldn't be called without calling yr_initialize first

  if (init_count == 0)
    return ERROR_INTERNAL_FATAL_ERROR;

  yr_re_finalize_thread();

  init_count--;

  if (init_count > 0)
    return ERROR_SUCCESS;

  #if defined HAVE_LIBCRYPTO && OPENSSL_VERSION_NUMBER < 0x10100000L

  for (i = 0; i < CRYPTO_num_locks(); i ++)
    yr_mutex_destroy(&openssl_locks[i]);

  OPENSSL_free(openssl_locks);

  #endif

  FAIL_ON_ERROR(yr_thread_storage_destroy(&tidx_key));
  FAIL_ON_ERROR(yr_thread_storage_destroy(&recovery_state_key));
  FAIL_ON_ERROR(yr_re_finalize());
  FAIL_ON_ERROR(yr_modules_finalize());
  FAIL_ON_ERROR(yr_heap_free());

  return ERROR_SUCCESS;
}
Exemplo n.º 2
0
void yr_finalize(void)
{
  yr_re_finalize_thread();

  #ifdef WIN32
  TlsFree(key);
  #else
  pthread_key_delete(key);
  #endif

  yr_re_finalize();
  yr_heap_free();
}
Exemplo n.º 3
0
int yr_finalize(void)
{
  yr_re_finalize_thread();

  #ifdef _WIN32
  TlsFree(tidx_key);
  TlsFree(recovery_state_key);
  #else
  pthread_key_delete(tidx_key);
  pthread_key_delete(recovery_state_key);
  #endif

  FAIL_ON_ERROR(yr_re_finalize());
  FAIL_ON_ERROR(yr_modules_finalize());
  FAIL_ON_ERROR(yr_heap_free());

  return ERROR_SUCCESS;
}