diff options
Diffstat (limited to 'res/res_smdi.c')
-rw-r--r-- | res/res_smdi.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/res/res_smdi.c b/res/res_smdi.c index 8adab88d1..e8607ebe1 100644 --- a/res/res_smdi.c +++ b/res/res_smdi.c @@ -59,7 +59,8 @@ static int smdi_load(int reload); /* Use count stuff */ -STANDARD_USECOUNT_DECL; +AST_MUTEX_DEFINE_STATIC(localuser_lock); +static int localusecnt = 0; /*! \brief SMDI interface container. */ struct ast_smdi_interface_container { @@ -504,7 +505,10 @@ void ast_smdi_interface_destroy(struct ast_smdi_interface *iface) ASTOBJ_CONTAINER_DESTROY(&iface->mwi_q); free(iface); - STANDARD_DECREMENT_USECOUNT; + ast_mutex_lock(&localuser_lock); + localusecnt--; + ast_mutex_unlock(&localuser_lock); + ast_update_use_count(); } /*! @@ -688,7 +692,10 @@ static int smdi_load(int reload) ASTOBJ_CONTAINER_LINK(&smdi_ifaces, iface); ASTOBJ_UNREF(iface, ast_smdi_interface_destroy); - STANDARD_INCREMENT_USECOUNT; + ast_mutex_lock(&localuser_lock); + localusecnt++; + ast_mutex_unlock(&localuser_lock); + ast_update_use_count(); } else { ast_log(LOG_NOTICE, "Ignoring unknown option %s in %s\n", v->name, config_file); } |