Enable REF_DEBUG for ast_module_ref / ast_module_unref.
authorCorey Farrell <git@cfware.com>
Wed, 11 Feb 2015 17:03:04 +0000 (17:03 +0000)
committerCorey Farrell <git@cfware.com>
Wed, 11 Feb 2015 17:03:04 +0000 (17:03 +0000)
commit8cc50b1ebc3fe6eacd2a03a8c8bc4800bdddfbe9
treeda998029b1bb125ecdec651fe89ce3f0f9b8a5d6
parent137c4b0778928040dff81f15b770211ee1ead320
Enable REF_DEBUG for ast_module_ref / ast_module_unref.

Add ast_module_shutdown_ref for use by modules that can
only be unloaded during graceful shutdown.

When REF_DEBUG is enabled:
* Add an empty ao2 object to struct ast_module.
* Allocate ao2 object when the module is loaded.
* Perform an ao2_ref in each place where mod->usecount is manipulated.
* ao2_cleanup on module unload.

ASTERISK-24479 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4141/
........

Merged revisions 431662 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 431663 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431672 65c4cc65-6c06-0410-ace0-fbb531ad65f3
bridges/bridge_builtin_features.c
include/asterisk/module.h
main/loader.c