pub fn shutdown() {
    {
        let _lock = global_write();
        unsafe { sys::shutdown() };
    }

    // de-allocate `BEFORE_SEND`
    if let Some(before_send) = BEFORE_SEND.get() {
        before_send
            .lock()
            .expect("failed to deallocate `BEFORE_SEND`")
            .take();
    }

    // de-allocate `LOGGER`
    LOGGER
        .write()
        .expect("failed to deallocate `LOGGER`")
        .take();
}
/// Shuts down the Sentry client and forces transports to flush out.
///
/// # Examples
/// ```
/// # use anyhow::Result;
/// # use sentry_contrib_native::{Options, shutdown};
/// fn main() -> Result<()> {
///     sentry_init()?;
///
///     // ...
///     // your application code
///     // ...
///
///     // call shutdown manually to make sure transports flush out
///     shutdown();
///     Ok(())
/// }
///
/// fn sentry_init() -> Result<()> {
///     let options = Options::new();
///     // `forget` to not automatically shutdown Sentry
///     options.init()?.forget();
///     Ok(())
/// }
/// ```
Shuts down the Sentry client and forces transports to flush out.
Shuts down the Sentry client and forces transports to flush out .
pub fn shutdown() {
    {
        let _lock = global_write();
        unsafe { sys::shutdown() };
    }
    // de-allocate `BEFORE_SEND`
    if let Some(before_send) = BEFORE_SEND.get() {
        before_send
            .lock()
            .expect("failed to deallocate `BEFORE_SEND`")
            .take();
    }
    // de-allocate `LOGGER`
    LOGGER
        .write()
        .expect("failed to deallocate `LOGGER`")
        .take();
}
pub fn shutdown ( ) { { let _lock = global_write ( ) ; unsafe { sys :: shutdown ( ) } ; } // de-allocate `BEFORE_SEND` if let Some ( before_send ) = BEFORE_SEND . get ( ) { before_send . lock ( ) . expect ( " " ) . take ( ) ; } // de-allocate `LOGGER` LOGGER . write ( ) . expect ( " " ) . take ( ) ; }
Shuts down the Sentry client and forces transports to flush out.
Shuts down the Sentry client and forces transports to flush out .
examples
None
use anyhow::result;
None
use sentry_contrib_native::{options, shutdown};


your application code

call shutdown manually to make sure transports flush out
shutdown();
Ok(())
}

fn sentry_init() -> Result<()> {
let options = Options::new();
`forget` to not automatically shutdown Sentry
options.init()?.forget();
Ok(())
}
```
your application code call shutdown manually to make sure transports flush out shutdown () ; Ok (( )) } fn sentry_init () - > Result< () > { let options = Options :: new () ; ` forget ` to not automatically shutdown Sentry options . init () ? . forget () ; Ok (( )) } ` ` `