Skip to content

Commit cc7bf6f

Browse files
committed
Apply review suggestions
1 parent ff6358b commit cc7bf6f

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

datafusion/ffi/src/config/extension_options.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,13 @@ unsafe extern "C" fn entries_fn_wrapper(
109109
}
110110

111111
unsafe extern "C" fn release_fn_wrapper(options: &mut FFI_ExtensionOptions) {
112-
let private_data = unsafe {
113-
Box::from_raw(options.private_data as *mut ExtensionOptionsPrivateData)
114-
};
115-
drop(private_data);
112+
unsafe {
113+
debug_assert!(!options.private_data.is_null());
114+
let private_data =
115+
Box::from_raw(options.private_data as *mut ExtensionOptionsPrivateData);
116+
drop(private_data);
117+
options.private_data = std::ptr::null_mut();
118+
}
116119
}
117120

118121
impl Default for FFI_ExtensionOptions {

datafusion/ffi/src/session/config.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ use datafusion_execution::config::SessionConfig;
3737
#[repr(C)]
3838
#[derive(Debug, StableAbi)]
3939
pub struct FFI_SessionConfig {
40-
/// Return a hash map from key to value of the config options represented
41-
/// by string values.
40+
/// FFI stable configuration options.
4241
pub config_options: FFI_ConfigOptions,
4342

4443
/// Used to create a clone on the provider of the execution plan. This should

0 commit comments

Comments
 (0)