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);
}
}
}
}
imo, it's better to wrap the appender handle into its own type, and use that instead like for DataChunkHandle here. There is few other places where the appender is passed around, which could possibly cause use after free errors.
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.