mirror of
https://github.com/typesense/typesense.git
synced 2025-05-21 06:02:26 +08:00
Move lock inside hnsw_t destructor.
This commit is contained in:
parent
1f6fbed372
commit
f608656393
@ -323,6 +323,7 @@ struct hnsw_index_t {
|
||||
}
|
||||
|
||||
~hnsw_index_t() {
|
||||
std::lock_guard lk(repair_m);
|
||||
delete vecdex;
|
||||
delete space;
|
||||
}
|
||||
|
@ -217,7 +217,6 @@ Index::~Index() {
|
||||
delete seq_ids;
|
||||
|
||||
for(auto& vec_index_kv: vector_index) {
|
||||
std::unique_lock lock(vec_index_kv.second->repair_m);
|
||||
delete vec_index_kv.second;
|
||||
}
|
||||
|
||||
@ -7010,7 +7009,6 @@ void Index::refresh_schemas(const std::vector<field>& new_fields, const std::vec
|
||||
|
||||
if(del_field.num_dim) {
|
||||
auto hnsw_index = vector_index[del_field.name];
|
||||
std::unique_lock lock(hnsw_index->repair_m);
|
||||
delete hnsw_index;
|
||||
vector_index.erase(del_field.name);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user