MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / shutdown

Function shutdown

rust/src/headless.rs:73–84  ·  view source on GitHub ↗

Unloads plugins, stops all worker threads, and closes open logs. If the core was initialized using an enterprise license, that will also be freed. ⚠️ Important! Must be called at the end of scripts. ⚠️

()

Source from the content-addressed store, hash-verified

71///
72/// ⚠️ Important! Must be called at the end of scripts. ⚠️
73pub fn shutdown() {
74 match crate::product().as_str() {
75 "Binary Ninja Enterprise Client" | "Binary Ninja Ultimate" => {
76 if NEED_LICENSE_RELEASE.load(SeqCst) {
77 enterprise::release_license()
78 }
79 }
80 _ => {}
81 }
82 unsafe { binaryninjacore_sys::BNShutdown() };
83 // TODO: We might want to drop the main thread here, however that requires getting the handler ctx to drop the sender.
84}
85
86pub fn is_shutdown_requested() -> bool {
87 unsafe { binaryninjacore_sys::BNIsShutdownRequested() }

Callers 2

dropMethod · 0.70
test_license_validationFunction · 0.50

Calls 4

productFunction · 0.85
as_strMethod · 0.80
release_licenseFunction · 0.70
loadMethod · 0.45

Tested by 1

test_license_validationFunction · 0.40