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. ⚠️
()
| 71 | /// |
| 72 | /// ⚠️ Important! Must be called at the end of scripts. ⚠️ |
| 73 | pub 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 | |
| 86 | pub fn is_shutdown_requested() -> bool { |
| 87 | unsafe { binaryninjacore_sys::BNIsShutdownRequested() } |