We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
cb_free_type_list
1 parent a9a002c commit 8360abdCopy full SHA for 8360abd
rust/src/architecture.rs
@@ -2954,9 +2954,12 @@ where
2954
A: 'static + Architecture<Handle = CustomArchitectureHandle<A>> + Send + Sync,
2955
{
2956
let _custom_arch = unsafe { &*(ctxt as *mut A) };
2957
- let boxed_types = unsafe { Box::from_raw(std::ptr::slice_from_raw_parts_mut(tl, count)) };
2958
- for ty in boxed_types {
2959
- Conf::<Ref<Type>>::free_raw(ty);
+ if !tl.is_null() {
+ let boxed_types =
+ unsafe { Box::from_raw(std::ptr::slice_from_raw_parts_mut(tl, count)) };
2960
+ for ty in boxed_types {
2961
+ Conf::<Ref<Type>>::free_raw(ty);
2962
+ }
2963
}
2964
2965
0 commit comments