mirror of https://github.com/milvus-io/milvus.git
Merge branch 'branch-0.4.0' into 'branch-0.4.0'
Fix memory double free issue due to random_device See merge request megasearch/milvus!524 Former-commit-id: 970d947cb84c3317333e7229d1d0c3259623bc71pull/191/head
commit
5c9145aeb7
|
@ -57,8 +57,8 @@ Action::PushTaskToNeighbourRandomly(const TaskPtr &task,
|
|||
total_speed += speed;
|
||||
}
|
||||
|
||||
std::random_device rd;
|
||||
std::mt19937 mt(rd());
|
||||
unsigned seed1 = std::chrono::system_clock::now().time_since_epoch().count();
|
||||
std::mt19937 mt(seed1);
|
||||
std::uniform_int_distribution<int> dist(0, total_speed);
|
||||
uint64_t index = 0;
|
||||
int64_t rd_speed = dist(mt);
|
||||
|
|
Loading…
Reference in New Issue