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

[cpp_api] Update Deleter to not free null pointers. #5262

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

teo-tsirpanis
Copy link
Member

@teo-tsirpanis teo-tsirpanis commented Aug 28, 2024

SC-53365

This PR updates the Deleter class do nothing when a null pointer is passed to it. Previously it would pass the pointer to tiledb_***_free, which would cause an error that gets ignored because most APIs return void, and emit an error log message. This resulted in lots of noise in CI logs.

There are some cases in the C++ API where a null handle would be attempted to be freed, like here or here. Some of them can be eliminated by refactoring the initialization of the smart pointers, but this change is nevertheless valuable, because not all cases can be migrated, and null smart pointers are valid either way.


TYPE: CPP_API
DESC: Fix error log messages when using the Array class in the C++ API.

@teo-tsirpanis
Copy link
Member Author

No error log messages were emitted related to invalid handles (before vs after). This is ready for review.

Copy link
Contributor

@eric-hughes-tiledb eric-hughes-tiledb left a comment

Choose a reason for hiding this comment

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

LGTM

@KiterLuc KiterLuc merged commit 84ff80c into dev Sep 3, 2024
64 checks passed
@KiterLuc KiterLuc deleted the teo/deleter-nullptr branch September 3, 2024 14:03
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