Make sure that we don't keep a reference on the LMDB key when using put_current

This commit is contained in:
Kerollmops 2021-07-21 10:35:35 +02:00
parent fa44e95c91
commit 9f8095c069
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4

View File

@ -366,6 +366,7 @@ impl<'t, 'u, 'i> DeleteDocuments<'t, 'u, 'i> {
// safety: we don't keep references from inside the LMDB database. // safety: we don't keep references from inside the LMDB database.
unsafe { iter.del_current()? }; unsafe { iter.del_current()? };
} else if docids.len() != previous_len { } else if docids.len() != previous_len {
let key = key.to_owned();
// safety: we don't keep references from inside the LMDB database. // safety: we don't keep references from inside the LMDB database.
unsafe { iter.put_current(&key, &docids)? }; unsafe { iter.put_current(&key, &docids)? };
} }