* Make ast_sorcery_observer_remove() accept a const callbacks struct.
* Make ast_sorcery_observer_remove() tolerant of the sorcery parameter
being NULL. Now it can be called within a module unload routine if the
sorcery initialization fails.
* Fix ast_sorcery_observer_add() to fail if the container link fails.
........
Merged revisions 403324 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403327 65c4cc65-6c06-0410-ace0-fbb531ad65f3
A common idiom in Asterisk is to due something like:
for (ao2_obj = list_beginning; ao2_obj = next_item; ao2_ref(ao2_obj, -1)) {
...do stuff...
}
This is nice because it automatically takes care of the object references
for you. However, there is a pitfall here. If a break statement is in the
for loop, then the current reference is not cleaned up. In some cases, this
is on purpose, but in others there is a leak. This commit fixes the leak
cases.
........
Merged revisions 401248 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401249 65c4cc65-6c06-0410-ace0-fbb531ad65f3