mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-03 04:19:18 +08:00
Fix mem leak when load index
Signed-off-by: xige-16 <xi.ge@zilliz.com>
This commit is contained in:
parent
56d367b1e9
commit
22eda19bc4
@ -124,6 +124,12 @@ NewBinarySet(CBinarySet* c_binary_set) {
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
DeleteBinarySet(CBinarySet c_binary_set) {
|
||||
auto binary_set = (milvus::knowhere::BinarySet*)c_binary_set;
|
||||
delete binary_set;
|
||||
}
|
||||
|
||||
CStatus
|
||||
AppendBinaryIndex(CBinarySet c_binary_set, void* index_binary, int64_t index_size, const char* c_index_key) {
|
||||
try {
|
||||
|
@ -41,6 +41,9 @@ AppendIndex(CLoadIndexInfo c_load_index_info, CBinarySet c_binary_set);
|
||||
CStatus
|
||||
NewBinarySet(CBinarySet* c_binary_set);
|
||||
|
||||
void
|
||||
DeleteBinarySet(CBinarySet c_binary_set);
|
||||
|
||||
CStatus
|
||||
AppendBinaryIndex(CBinarySet c_binary_set, void* index_binary, int64_t index_size, const char* c_index_key);
|
||||
|
||||
|
@ -73,6 +73,7 @@ func (li *LoadIndexInfo) appendFieldInfo(fieldID int64) error {
|
||||
func (li *LoadIndexInfo) appendIndex(bytesIndex [][]byte, indexKeys []string) error {
|
||||
var cBinarySet C.CBinarySet
|
||||
status := C.NewBinarySet(&cBinarySet)
|
||||
defer C.DeleteBinarySet(cBinarySet)
|
||||
|
||||
errorCode := status.error_code
|
||||
if errorCode != 0 {
|
||||
|
Loading…
Reference in New Issue
Block a user