pub fn audio_reg_hardware_hook_remove<T>(
        &mut self,
        handle: RegistrationHandle<T>,
    ) -> Option<Box<T>>
    where
        T: OnAudioBuffer,
    {
        // Unregister the low-level audio hook register from REAPER
        let reaper_ptr = handle.reaper_ptr().cast();
        unsafe { self.audio_reg_hardware_hook_remove_unchecked(reaper_ptr) };
        // Take the owned audio hook register out of its storage
        let owned_audio_hook_register = self
            .audio_hook_registers
            .release(handle.reaper_ptr().cast())?;
        // Reconstruct the initial value for handing ownership back to the consumer
        let dyn_callback = owned_audio_hook_register.into_callback();
        // We are not interested in the fat pointer (Box<dyn OnAudioBuffer>) anymore.
        // By calling leak(), we make the pointer go away but prevent Rust from
        // dropping its content.
        Box::leak(dyn_callback);
        // Here we pick up the content again and treat it as a Box - but this
        // time not a trait object box (Box<dyn OnAudioBuffer> = fat pointer) but a
        // normal box (Box<T> = thin pointer) ... original type restored.
        let callback = unsafe { handle.restore_original() };
        Some(callback)
    }
/// Unregisters an audio hook register and hands ownership back to you.
///
/// If the audio hook register is not registered, this function just returns `None`.
///
/// This only needs to be called if you explicitly want the audio hook to "stop" while your
/// plug-in is still running. You don't need to call this for cleaning up because this
/// struct takes care of unregistering everything safely when it gets dropped.
///
/// REAPER guarantees via proper synchronization that after this method returns, the callback
/// is not in the process of being called and also will not be called anymore. However, it is
/// *not* guaranteed that the last callback invocation has `is_post == true`.
Unregisters an audio hook register and hands ownership back to you.
If the audio hook register is not registered, this function just returns `None`.

This only needs to be called if you explicitly want the audio hook to "stop" while your
plug-in is still running. You don't need to call this for cleaning up because this
struct takes care of unregistering everything safely when it gets dropped.

REAPER guarantees via proper synchronization that after this method returns, the callback
is not in the process of being called and also will not be called anymore. However, it is
not* guaranteed that the last callback invocation has `is_post == true`.
Unregisters an audio hook register and hands ownership back to you . If the audio hook register is not registered this function just returns ` None ` . This only needs to be called if you explicitly want the audio hook to " stop " while your plug - in is still running . You don ' t need to call this for cleaning up because this struct takes care of unregistering everything safely when it gets dropped . REAPER guarantees via proper synchronization that after this method returns the callback is not in the process of being called and also will not be called anymore . However it is not * guaranteed that the last callback invocation has ` is_post == true ` .
pub fn audio_reg_hardware_hook_remove<T>(
        &mut self,
        handle: RegistrationHandle<T>,
    ) -> Option<Box<T>>
    where
        T: OnAudioBuffer,
    {
        // Unregister the low-level audio hook register from REAPER
        let reaper_ptr = handle.reaper_ptr().cast();
        unsafe { self.audio_reg_hardware_hook_remove_unchecked(reaper_ptr) };
        // Take the owned audio hook register out of its storage
        let owned_audio_hook_register = self
            .audio_hook_registers
            .release(handle.reaper_ptr().cast())?;
        // Reconstruct the initial value for handing ownership back to the consumer
        let dyn_callback = owned_audio_hook_register.into_callback();
        // We are not interested in the fat pointer (Box<dyn OnAudioBuffer>) anymore.
        // By calling leak(), we make the pointer go away but prevent Rust from
        // dropping its content.
        Box::leak(dyn_callback);
        // Here we pick up the content again and treat it as a Box - but this
        // time not a trait object box (Box<dyn OnAudioBuffer> = fat pointer) but a
        // normal box (Box<T> = thin pointer) ... original type restored.
        let callback = unsafe { handle.restore_original() };
        Some(callback)
    }
pub fn audio_reg_hardware_hook_remove < T > ( & mut self , handle : RegistrationHandle < T > , ) -> Option < Box < T > > where T : OnAudioBuffer , { // Unregister the low-level audio hook register from REAPER let reaper_ptr = handle . reaper_ptr ( ) . cast ( ) ; unsafe { self . audio_reg_hardware_hook_remove_unchecked ( reaper_ptr ) } ; // Take the owned audio hook register out of its storage let owned_audio_hook_register = self . audio_hook_registers . release ( handle . reaper_ptr ( ) . cast ( ) ) ? ; // Reconstruct the initial value for handing ownership back to the consumer let dyn_callback = owned_audio_hook_register . into_callback ( ) ; // We are not interested in the fat pointer (Box<dyn OnAudioBuffer>) anymore. // By calling leak(), we make the pointer go away but prevent Rust from // dropping its content. Box :: leak ( dyn_callback ) ; // Here we pick up the content again and treat it as a Box - but this // time not a trait object box (Box<dyn OnAudioBuffer> = fat pointer) but a // normal box (Box<T> = thin pointer) ... original type restored. let callback = unsafe { handle . restore_original ( ) } ; Some ( callback ) }
Unregisters an audio hook register and hands ownership back to you.
Unregisters an audio hook register and hands ownership back to you .
&mut self
handle
RegistrationHandle<T>
&mut self
handle
RegistrationHandle<T>