Skip to main content

luaur_code_gen/methods/
shared_code_gen_context_on_destroy_function.rs

1use crate::functions::get_native_proto_exec_data_header_native_proto_exec_data_alt_b::get_native_proto_exec_data_header;
2use crate::records::shared_code_gen_context::SharedCodeGenContext;
3
4impl SharedCodeGenContext {
5    pub unsafe extern "C" fn on_destroy_function(execdata: *mut core::ffi::c_void) {
6        let native_proto_exec_data_header =
7            get_native_proto_exec_data_header(execdata as *const u32);
8        unsafe {
9            (*native_proto_exec_data_header)
10                .native_module
11                .as_ref()
12                .unwrap()
13                .release();
14        }
15    }
16}