Fix possible crash in DLL_THREAD_DETACH (explodes in .Net Framework)

incre
Alexey Naumov 11 years ago committed by Howard Chu
parent c0d64cf182
commit a93810cc3d
  1. 2
      libraries/liblmdb/mdb.c

@ -3677,8 +3677,10 @@ static void NTAPI mdb_tls_callback(PVOID module, DWORD reason, PVOID ptr)
case DLL_THREAD_DETACH: case DLL_THREAD_DETACH:
for (i=0; i<mdb_tls_nkeys; i++) { for (i=0; i<mdb_tls_nkeys; i++) {
MDB_reader *r = pthread_getspecific(mdb_tls_keys[i]); MDB_reader *r = pthread_getspecific(mdb_tls_keys[i]);
if (r) {
mdb_env_reader_dest(r); mdb_env_reader_dest(r);
} }
}
break; break;
case DLL_PROCESS_DETACH: break; case DLL_PROCESS_DETACH: break;
} }

Loading…
Cancel
Save