--- a/rust/lib-hedgewars-engine/src/lib.rs Sun Nov 13 08:45:10 2022 +0100
+++ b/rust/lib-hedgewars-engine/src/lib.rs Tue Nov 15 14:27:22 2022 +0100
@@ -113,7 +113,7 @@
}
#[no_mangle]
-pub extern "C" fn dispose_preview(engine_state: &mut EngineInstance, preview: &mut PreviewInfo) {
+pub extern "C" fn dispose_preview(engine_state: &mut EngineInstance) {
(*engine_state).world.dispose_preview();
}
@@ -142,7 +142,7 @@
engine_state: &mut EngineInstance,
width: u16,
height: u16,
- gl_loader: extern "C" fn(*const c_char) -> *const c_void,
+ gl_loader: extern "C" fn(*const c_char) -> *mut c_void,
) {
gl::load_with(|name| {
let c_name = CString::new(name).unwrap();
@@ -175,6 +175,6 @@
#[no_mangle]
pub extern "C" fn cleanup(engine_state: *mut EngineInstance) {
unsafe {
- Box::from_raw(engine_state);
+ drop(Box::from_raw(engine_state));
}
}