diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-06-07 19:00:37 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-06-07 19:00:37 +0000 |
commit | 206e7279dbbfbd760da7c0233829bde1c62d4878 (patch) | |
tree | 41d4f8bf72c0dc7f33ae7e9c2db5d28abfd553e0 /res/res_smdi.c | |
parent | bb605129de768a91dd543d1ab1af04fc73628a65 (diff) |
Merged revisions 268653,268731 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r268653 | tilghman | 2010-06-07 12:14:40 -0500 (Mon, 07 Jun 2010) | 2 lines
Avoid unloading res_smdi twice.
(closes issue #17237)
Reported by: pabelanger
........
r268731 | tilghman | 2010-06-07 13:59:27 -0500 (Mon, 07 Jun 2010) | 4 lines
Event well was going dry.
(issue #17234)
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@268732 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_smdi.c')
-rw-r--r-- | res/res_smdi.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/res/res_smdi.c b/res/res_smdi.c index 669b06521..f0fa6f473 100644 --- a/res/res_smdi.c +++ b/res/res_smdi.c @@ -58,6 +58,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #define SMDI_MSG_EXPIRY_TIME 30000 /* 30 seconds */ static const char config_file[] = "smdi.conf"; +static int smdi_loaded; /*! \brief SMDI message desk message queue. */ struct ast_smdi_md_queue { @@ -1340,6 +1341,7 @@ static int _unload_module(int fromload); static int load_module(void) { int res; + smdi_loaded = 1; /* initialize our containers */ memset(&smdi_ifaces, 0, sizeof(smdi_ifaces)); @@ -1367,6 +1369,10 @@ static int load_module(void) static int _unload_module(int fromload) { + if (!smdi_loaded) { + return 0; + } + /* this destructor stops any running smdi_read threads */ ASTOBJ_CONTAINER_DESTROYALL(&smdi_ifaces, ast_smdi_interface_destroy); ASTOBJ_CONTAINER_DESTROY(&smdi_ifaces); @@ -1387,6 +1393,7 @@ static int _unload_module(int fromload) ast_custom_function_unregister(&smdi_msg_function); } + smdi_loaded = 0; return 0; } |