slowly figuring it out

This commit is contained in:
🪞👃🪞 2024-07-24 16:42:24 +03:00
parent b1d8fc62a9
commit ef619c595a
2 changed files with 17 additions and 10 deletions

View file

@ -5,7 +5,13 @@ pub mod bound;
pub struct Host(*mut self::bound::SuilHost);
pub struct Instance(*mut self::bound::SuilInstance);
impl Drop for Host {
fn drop (&mut self) -> () {
unsafe {
bound::suil_host_free(self.0)
}
}
}
impl Host {
pub fn new () -> Self {
@ -87,13 +93,7 @@ unsafe extern "C" fn index (
//0
//}
impl Drop for Host {
fn drop (&mut self) -> () {
unsafe {
bound::suil_host_free(self.0)
}
}
}
pub struct Instance(*mut self::bound::SuilInstance);
impl Drop for Instance {
fn drop (&mut self) -> () {
@ -106,3 +106,9 @@ impl Drop for Instance {
unsafe impl Send for Instance {}
unsafe impl Sync for Instance {}
impl Instance {
fn get_widget (&self) -> *mut c_void {
unsafe { bound::suil_instance_get_widget(self.0) }
}
}