Skip to content

Commit 5123925

Browse files
committed
Fix crash when using projects API in rust with enterprise
1 parent 8778721 commit 5123925

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

rust/src/project.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ impl Project {
4040
/// * `path` - Path to the project directory (.bnpr)
4141
/// * `name` - Name of the new project
4242
pub fn create<P: BnStrCompatible, S: BnStrCompatible>(path: P, name: S) -> Self {
43+
unsafe { BNInitPlugins(true) };
4344
let path_raw = path.into_bytes_with_nul();
4445
let name_raw = name.into_bytes_with_nul();
4546
let handle = unsafe {
@@ -55,6 +56,7 @@ impl Project {
5556
///
5657
/// * `path` - Path to the project directory (.bnpr) or project metadata file (.bnpm)
5758
pub fn open_project<P: BnStrCompatible>(path: P) -> Self {
59+
unsafe { BNInitPlugins(true) };
5860
let path_raw = path.into_bytes_with_nul();
5961
let handle = unsafe { BNOpenProject(path_raw.as_ref().as_ptr() as *const ffi::c_char) };
6062
unsafe { Self::from_raw(NonNull::new(handle).unwrap()) }

0 commit comments

Comments
 (0)