diff --git a/src/runner/instance.rs b/src/runner/instance.rs index 49714e0..093897c 100644 --- a/src/runner/instance.rs +++ b/src/runner/instance.rs @@ -219,6 +219,12 @@ impl Instance{ Ok(crate::context::class_is_a(instance.class.as_str(),classname.to_str()?)) }) ); + methods.add_method("Destroy",|lua,this,()| + dom(lua,|dom|{ + dom.destroy(this.referent()); + Ok(()) + }) + ); methods.add_meta_function(mlua::MetaMethod::Index,|lua,(this,index):(mlua::AnyUserData,mlua::String)|{ let index_str=index.to_str()?; let dereferent:Dereferent=mlua::AnyUserDataExt::get(&this,"Referent")?;