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

impl Drop for Appender has unnecessary unsafe calls. #266

Open
era127 opened this issue Feb 19, 2024 · 0 comments
Open

impl Drop for Appender has unnecessary unsafe calls. #266

era127 opened this issue Feb 19, 2024 · 0 comments

Comments

@era127
Copy link

era127 commented Feb 19, 2024

According to the C appender api documentation, the drop of appender should only need to call duckdb_appender_destroy. I believe the flush and duckdb_appender_close call can be removed.

impl Drop for Appender<'_> {
    fn drop(&mut self) {
        if !self.app.is_null() {
  // remove     self.flush();
            unsafe {
  // remove     ffi::duckdb_appender_close(self.app);
                ffi::duckdb_appender_destroy(&mut self.app);
            }
        }
    }
}
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

No branches or pull requests

1 participant