From 01a224425d2a90e660bbfffe8d1cbc6b93da24bd Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Mon, 27 Jan 2025 16:56:15 -0500 Subject: 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 :/ --- rust/src/platform.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rust/src/platform.rs') 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(&self, name: T) -> Array { -- cgit v1.3.1