luaur_code_gen/methods/standalone_code_gen_context_on_close_state.rs
1use crate::records::standalone_code_gen_context::StandaloneCodeGenContext;
2
3impl StandaloneCodeGenContext {
4 pub fn on_close_state(&mut self) {
5 // The StandaloneCodeGenContext is owned by the one VM that owns it, so when
6 // that VM is destroyed, we destroy *this as well:
7 unsafe {
8 let _ = Box::from_raw(self);
9 }
10 }
11}
12
13#[allow(non_snake_case)]
14pub fn standalone_code_gen_context_on_close_state(this: &mut StandaloneCodeGenContext) {
15 this.on_close_state();
16}