diff --git a/include/utils/lock_table.h b/include/utils/lock_table.h index b59e5da..8f1d0e3 100644 --- a/include/utils/lock_table.h +++ b/include/utils/lock_table.h @@ -131,6 +131,10 @@ namespace pipeann { } } ~LockTable() { + for (size_t i = 0; i < size_; i++) { + pthread_rwlock_destroy(&locks_[i]); + } + delete[] locks_; } inline pthread_rwlock_t *rdlock(uint32_t key) { @@ -262,4 +266,4 @@ namespace pipeann { } // namespace pipeann -#endif // LOCK_TABLE_H_ \ No newline at end of file +#endif // LOCK_TABLE_H_