Register a callback that will be invoked when the last shutdown function is called.


#include <bps/bps.h>
BPS_API int bps_register_shutdown_handler(void(*shutdown_handler)(void *),
                                          void *data)


BlackBerry 10.0.0



The function for platform services to call when the library is shutting down. BPS passes the data that the caller provided as the first argument.


The user data that is passed as the first argument when the BPS calls the shutdown handler.


libbps (For the qcc command, use the -l bps option to link against this library)


Shutdown handlers/callbacks are called when bps_shutdown() is called for the last time. BPS tracks how many times bps_initialize() has been called, and when bps_shutdown() has been called the same number of times (i.e., a reference count drops to 0), the shutdown handlers are called.

This function cleans up a service's global data. Typically, a service has to reset the domain ID to indicate it has been uninitialized. Other cleanup activities depend on the service's implementation.


BPS_SUCCESS is returned if the handler registered successfully with the data, BPS_FAILURE with errno value set otherwise.

Last modified: 2014-09-30

Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus