pub fn unbind_event_handler(handler: &EventHandler)
{
    let id = handler.id;
    let subclass_id = handler.subclass_id;
    let mut callback_ptr: *mut *const Callback = ptr::null_mut();

    for &handle in handler.handles.iter() {
        unsafe { 
            let mut callback_value: UINT_PTR = 0;
            let result = GetWindowSubclass(handle, id, subclass_id, &mut callback_value);
            if result == 0 {
                panic!("Parent of hander was either freed or is already unbound");
            }

            callback_ptr = callback_value as *mut *const Callback;
            let callback: Rc<Callback> = Rc::from_raw(*callback_ptr);
            mem::drop(callback);

            RemoveWindowSubclass(handle, id, subclass_id);
        };
    }

    // Finally free the pointer to the pointer to the callback
    unsafe {
        Box::from_raw(callback_ptr);
    }
}
/**
    Free all associated callbacks with the event handler.

    This function will panic if the handler was already freed.
*/
Free all associated callbacks with the event handler.
This function will panic if the handler was already freed.
Free all associated callbacks with the event handler . This function will panic if the handler was already freed .
pub fn unbind_event_handler(handler: &EventHandler)
{
    let id = handler.id;
    let subclass_id = handler.subclass_id;
    let mut callback_ptr: *mut *const Callback = ptr::null_mut();
    for &handle in handler.handles.iter() {
        unsafe { 
            let mut callback_value: UINT_PTR = 0;
            let result = GetWindowSubclass(handle, id, subclass_id, &mut callback_value);
            if result == 0 {
                panic!("Parent of hander was either freed or is already unbound");
            }
            callback_ptr = callback_value as *mut *const Callback;
            let callback: Rc<Callback> = Rc::from_raw(*callback_ptr);
            mem::drop(callback);
            RemoveWindowSubclass(handle, id, subclass_id);
        };
    }
    // Finally free the pointer to the pointer to the callback
    unsafe {
        Box::from_raw(callback_ptr);
    }
}
pub fn unbind_event_handler ( handler : & EventHandler ) { let id = handler . id ; let subclass_id = handler . subclass_id ; let mut callback_ptr : * mut * const Callback = ptr :: null_mut ( ) ; for & handle in handler . handles . iter ( ) { unsafe { let mut callback_value : UINT_PTR = 0 ; let result = GetWindowSubclass ( handle , id , subclass_id , & mut callback_value ) ; if result == 0 { panic ! ( " " ) ; } callback_ptr = callback_value as * mut * const Callback ; let callback : Rc < Callback > = Rc :: from_raw ( * callback_ptr ) ; mem :: drop ( callback ) ; RemoveWindowSubclass ( handle , id , subclass_id ) ; } ; } // Finally free the pointer to the pointer to the callback unsafe { Box :: from_raw ( callback_ptr ) ; } }
Free all associated callbacks with the event handler.
Free all associated callbacks with the event handler .
handler
&EventHandler