diff options
| author | KyleMiles <krm504@nyu.edu> | 2022-04-12 16:45:40 -0400 |
|---|---|---|
| committer | KyleMiles <krm504@nyu.edu> | 2022-04-12 16:45:40 -0400 |
| commit | 9c73b5f2b3f3963bb75ddb602ab5d6985df7ce93 (patch) | |
| tree | 82a867ac57bc88a99be471e9aa03605d4d9c2fa5 /rust | |
| parent | 70229f1a48db5dc11590dbd74bba5b341e9878ac (diff) | |
Rust API : Fix ref counting bug in CustomBinaryView creation, initialization, and parsing
Diffstat (limited to 'rust')
| -rw-r--r-- | rust/src/custombinaryview.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/rust/src/custombinaryview.rs b/rust/src/custombinaryview.rs index 48274fe4..645f5fd4 100644 --- a/rust/src/custombinaryview.rs +++ b/rust/src/custombinaryview.rs @@ -49,7 +49,7 @@ where { ffi_wrap!("BinaryViewTypeBase::is_valid_for", unsafe { let view_type = &*(ctxt as *mut T); - let data = BinaryView::from_raw(data); + let data = BinaryView::from_raw(BNNewViewReference(data)); view_type.is_valid_for(&data) }) @@ -61,7 +61,7 @@ where { ffi_wrap!("BinaryViewTypeBase::create", unsafe { let view_type = &*(ctxt as *mut T); - let data = BinaryView::from_raw(data); + let data = BinaryView::from_raw(BNNewViewReference(data)); let builder = CustomViewBuilder { view_type: view_type, @@ -94,7 +94,7 @@ where { ffi_wrap!("BinaryViewTypeBase::load_settings", unsafe { let view_type = &*(ctxt as *mut T); - let data = BinaryView::from_raw(data); + let data = BinaryView::from_raw(BNNewViewReference(data)); match view_type.load_settings_for_data(&data) { Ok(settings) => Ref::into_raw(settings).handle, |
