mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-14 22:08:28 +00:00
main/formats: Fix crash in ast_format_cmp during non-clean shutdown.
* Backport ast_register_cleanup from Asterisk 12. * Use ast_register_cleanup for format_attr_shutdown. ast_register_cleanup was originally commited in r390122 by dlee. (closes issue ASTERISK-23103) Reported by: JoshE git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@411310 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -89,6 +89,22 @@ int ast_pbx_init(void); /*!< Provided by pbx.c */
|
||||
*/
|
||||
int ast_register_atexit(void (*func)(void));
|
||||
|
||||
/*!
|
||||
* \since 11.9
|
||||
* \brief Register a function to be executed before Asterisk gracefully exits.
|
||||
*
|
||||
* If Asterisk is immediately shutdown (core stop now, or sending the TERM
|
||||
* signal), the callback is not run. When the callbacks are run, they are run in
|
||||
* sequence with ast_register_atexit() callbacks, in the reverse order of
|
||||
* registration.
|
||||
*
|
||||
* \param func The callback function to use.
|
||||
*
|
||||
* \retval 0 on success.
|
||||
* \retval -1 on error.
|
||||
*/
|
||||
int ast_register_cleanup(void (*func)(void));
|
||||
|
||||
/*!
|
||||
* \brief Unregister a function registered with ast_register_atexit().
|
||||
* \param func The callback function to unregister.
|
||||
|
||||
Reference in New Issue
Block a user