summaryrefslogtreecommitdiff
path: root/plugins/warp/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/warp/src')
-rw-r--r--plugins/warp/src/cache.rs10
-rw-r--r--plugins/warp/src/plugin/debug.rs2
2 files changed, 4 insertions, 8 deletions
diff --git a/plugins/warp/src/cache.rs b/plugins/warp/src/cache.rs
index 3df2dbf8..d9a5a8d1 100644
--- a/plugins/warp/src/cache.rs
+++ b/plugins/warp/src/cache.rs
@@ -9,18 +9,14 @@ pub use type_reference::*;
use binaryninja::binary_view::{BinaryView, BinaryViewExt};
use binaryninja::function::Function as BNFunction;
+use binaryninja::object_destructor::{register_object_destructor, ObjectDestructor};
use binaryninja::rc::Guard;
use binaryninja::rc::Ref as BNRef;
-use binaryninja::ObjectDestructor;
use std::hash::{DefaultHasher, Hash, Hasher};
pub fn register_cache_destructor() {
- pub static mut CACHE_DESTRUCTOR: CacheDestructor = CacheDestructor;
- #[allow(static_mut_refs)]
- // SAFETY: This can be done as the backing data is an opaque ZST.
- unsafe {
- CACHE_DESTRUCTOR.register()
- };
+ let destructor = register_object_destructor(CacheDestructor);
+ std::mem::forget(destructor);
}
/// A unique view ID, used for caching.
diff --git a/plugins/warp/src/plugin/debug.rs b/plugins/warp/src/plugin/debug.rs
index d220d329..4198ea30 100644
--- a/plugins/warp/src/plugin/debug.rs
+++ b/plugins/warp/src/plugin/debug.rs
@@ -3,7 +3,7 @@ use crate::{build_function, cache};
use binaryninja::binary_view::BinaryView;
use binaryninja::command::{Command, FunctionCommand};
use binaryninja::function::Function;
-use binaryninja::ObjectDestructor;
+use binaryninja::object_destructor::ObjectDestructor;
pub struct DebugFunction;