Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix memory leak of vector type #692

Merged
merged 1 commit into from
Feb 10, 2024
Merged

fix memory leak of vector type #692

merged 1 commit into from
Feb 10, 2024

Conversation

skyzh
Copy link
Member

@skyzh skyzh commented Jan 28, 2024

backport from skyzh#1 @UnpureRationalist


Hi there,

Thanks for your excellent tutotial for vector database beginners. When I follow your tutorial and test my implementions using the commands here, memory leak was reported by AddressSanitizer.

After debugging, I found the destructor of class Value was not implemented well for VECTOR type. So this PR fixed the bug by modifying destructor along with the copy constructor (The copy assignment operator do not need to change since it is pass by value).

After fixing the bug, the test can passed correctly without memory leak.

@skyzh skyzh requested a review from yliang412 January 28, 2024 10:56
Copy link
Member

@yliang412 yliang412 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@skyzh skyzh merged commit 905ba77 into master Feb 10, 2024
3 checks passed
@skyzh skyzh deleted the skyzh/vector-fix branch February 10, 2024 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants