callback used to drop [FFI_ArrowArray] when it is exported
(array: *mut FFI_ArrowArray)
| 78 | |
| 79 | // callback used to drop [FFI_ArrowArray] when it is exported |
| 80 | unsafe extern "C" fn release_array(array: *mut FFI_ArrowArray) { |
| 81 | if array.is_null() { |
| 82 | return; |
| 83 | } |
| 84 | let array = unsafe { &mut *array }; |
| 85 | |
| 86 | // take ownership of `private_data`, therefore dropping it` |
| 87 | let private = unsafe { Box::from_raw(array.private_data as *mut ArrayPrivateData) }; |
| 88 | for child in private.children.iter() { |
| 89 | let _ = unsafe { Box::from_raw(*child) }; |
| 90 | } |
| 91 | if !private.dictionary.is_null() { |
| 92 | let _ = unsafe { Box::from_raw(private.dictionary) }; |
| 93 | } |
| 94 | |
| 95 | array.release = None; |
| 96 | } |
| 97 | |
| 98 | /// Aligns the provided `nulls` to the provided `data_offset` |
| 99 | /// |