mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 04:11:08 +00:00
RTP documentation states that you can pass NULL as the module, so make sure that's really the case.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@247125 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1200,6 +1200,10 @@ int ast_loader_unregister(int (*v)(void))
|
|||||||
|
|
||||||
struct ast_module *ast_module_ref(struct ast_module *mod)
|
struct ast_module *ast_module_ref(struct ast_module *mod)
|
||||||
{
|
{
|
||||||
|
if (!mod) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
ast_atomic_fetchadd_int(&mod->usecount, +1);
|
ast_atomic_fetchadd_int(&mod->usecount, +1);
|
||||||
ast_update_use_count();
|
ast_update_use_count();
|
||||||
|
|
||||||
@@ -1208,6 +1212,10 @@ struct ast_module *ast_module_ref(struct ast_module *mod)
|
|||||||
|
|
||||||
void ast_module_unref(struct ast_module *mod)
|
void ast_module_unref(struct ast_module *mod)
|
||||||
{
|
{
|
||||||
|
if (!mod) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ast_atomic_fetchadd_int(&mod->usecount, -1);
|
ast_atomic_fetchadd_int(&mod->usecount, -1);
|
||||||
ast_update_use_count();
|
ast_update_use_count();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user