summaryrefslogtreecommitdiff
path: root/rust/src
diff options
context:
space:
mode:
authorRyan Snyder <ryan@vector35.com>2024-05-01 08:34:14 -0400
committerRyan Snyder <ryan@vector35.com>2024-05-01 08:34:14 -0400
commite0fb8752878a5edecf5d2d768d4f9571ca9e74d7 (patch)
tree25b14127dc7012aac6caea15086e5abe58f7c148 /rust/src
parent3ccfedef84b8743f7045c50cdeb3f78b530ada8d (diff)
parent3e444f221b4dfc37497342686732ba10dbcfa567 (diff)
Merge branch 'fix-form-input-builder' of github.com:rbran/binaryninja-api into dev
Diffstat (limited to 'rust/src')
-rw-r--r--rust/src/interaction.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/rust/src/interaction.rs b/rust/src/interaction.rs
index ccb5c81a..76fc9275 100644
--- a/rust/src/interaction.rs
+++ b/rust/src/interaction.rs
@@ -296,7 +296,9 @@ impl FormInputBuilder {
result.type_ = BNFormInputFieldType::AddressFormField;
result.prompt = prompt.as_ref().as_ptr() as *const c_char;
if let Some(view) = view {
- result.view = view.handle;
+ // the view is being moved into result, there is no need to clone
+ // and drop is intentionally being avoided with `Ref::into_raw`
+ result.view = unsafe { Ref::into_raw(view) }.handle;
}
result.currentAddress = current_address.unwrap_or(0);
result.hasDefault = default.is_some();