summaryrefslogtreecommitdiff
path: root/rust/src
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2024-07-29 11:31:42 -0400
committerMason Reed <mason@vector35.com>2024-07-29 11:44:34 -0400
commit51239253095ef558d2c06cda506fd3a4b13df760 (patch)
tree52392a3316fa6e49f6b6adcec07b12d61ae2f7ea /rust/src
parent8778721d7ff62a61d83dec2ba1d5ff139162eef7 (diff)
Fix crash when using projects API in rust with enterprise
Diffstat (limited to 'rust/src')
-rw-r--r--rust/src/project.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/rust/src/project.rs b/rust/src/project.rs
index a94b42e1..536b601e 100644
--- a/rust/src/project.rs
+++ b/rust/src/project.rs
@@ -40,6 +40,7 @@ impl Project {
/// * `path` - Path to the project directory (.bnpr)
/// * `name` - Name of the new project
pub fn create<P: BnStrCompatible, S: BnStrCompatible>(path: P, name: S) -> Self {
+ unsafe { BNInitPlugins(true) };
let path_raw = path.into_bytes_with_nul();
let name_raw = name.into_bytes_with_nul();
let handle = unsafe {
@@ -55,6 +56,7 @@ impl Project {
///
/// * `path` - Path to the project directory (.bnpr) or project metadata file (.bnpm)
pub fn open_project<P: BnStrCompatible>(path: P) -> Self {
+ unsafe { BNInitPlugins(true) };
let path_raw = path.into_bytes_with_nul();
let handle = unsafe { BNOpenProject(path_raw.as_ref().as_ptr() as *const ffi::c_char) };
unsafe { Self::from_raw(NonNull::new(handle).unwrap()) }