diff options
| author | Mason Reed <mason@vector35.com> | 2025-01-27 16:56:15 -0500 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2025-01-27 17:52:29 -0500 |
| commit | 01a224425d2a90e660bbfffe8d1cbc6b93da24bd (patch) | |
| tree | 4be2aa6c3154b4fb34e61815956dcd357c754e2c /rust/src/platform.rs | |
| parent | 9c9f5085e010059c813d2285ddff79b542c76834 (diff) | |
Fix some rust race conditions and comment some likely suspects
FYI The binary view saving stuff can deadlock right now, so we document that now :/
Diffstat (limited to 'rust/src/platform.rs')
| -rw-r--r-- | rust/src/platform.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rust/src/platform.rs b/rust/src/platform.rs index 62c61297..e732152c 100644 --- a/rust/src/platform.rs +++ b/rust/src/platform.rs @@ -90,7 +90,7 @@ impl Platform { if res.is_null() { None } else { - Some(Ref::new(Self { handle: res })) + Some(Self::ref_from_raw(res)) } } } @@ -176,7 +176,7 @@ impl Platform { // NOTE: I have no idea how this isn't a UAF, see the note in `TypeContainer::from_raw` // TODO: We are cloning here for platforms but we dont need to do this for [BinaryViewExt::type_container] // TODO: Why does this require that we, construct a TypeContainer, duplicate the type container, then drop the original. - unsafe { TypeContainer::from_raw(type_container_ptr.unwrap()).clone() } + unsafe { TypeContainer::from_raw(type_container_ptr.unwrap()) } } pub fn get_type_libraries_by_name<T: BnStrCompatible>(&self, name: T) -> Array<TypeLibrary> { |
