Shutdown and Draining

Learn more about the default behavior of our SDK if the application shuts down unexpectedly.

The default behavior of most SDKs is to send out events over the network asynchronously in the background. This means that some events might be lost if the application shuts down unexpectedly. The SDKs provide mechanisms to cope with this.

Copied
#include <sentry.h>

sentry_close();

Calling sentry_close() (formerly sentry_shutdown()) before exiting the application is critical to avoid data loss.

After closing, the client cannot be used anymore. It's important to only call sentry_close() immediately before shutting down the application.

Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").