[asterisk-commits] file: branch file/usecnt-cleanup r54142 - /team/file/usecnt-cleanup/main/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Feb 12 17:11:57 MST 2007


Author: file
Date: Mon Feb 12 18:11:57 2007
New Revision: 54142

URL: http://svn.digium.com/view/asterisk?view=rev&rev=54142
Log:
Make the unload function optional for modules, it may disappear in the future for some.

Modified:
    team/file/usecnt-cleanup/main/loader.c

Modified: team/file/usecnt-cleanup/main/loader.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/main/loader.c?view=diff&rev=54142&r1=54141&r2=54142
==============================================================================
--- team/file/usecnt-cleanup/main/loader.c (original)
+++ team/file/usecnt-cleanup/main/loader.c Mon Feb 12 18:11:57 2007
@@ -459,14 +459,15 @@
 
 	if (!error) {
 		__ast_module_user_hangup_all(mod);
-		res = mod->info->unload();
-
-		if (res) {
-			ast_log(LOG_WARNING, "Firm unload failed for %s\n", resource_name);
-			if (force <= AST_FORCE_FIRM)
-				error = 1;
-			else
-				ast_log(LOG_WARNING, "** Dangerous **: Unloading resource anyway, at user request\n");
+		if (mod->info->unload) {
+			res = mod->info->unload();
+			if (res) {
+				ast_log(LOG_WARNING, "Firm unload failed for %s\n", resource_name);
+				if (force <= AST_FORCE_FIRM)
+					error = 1;
+				else
+					ast_log(LOG_WARNING, "** Dangerous **: Unloading resource anyway, at user request\n");
+			}
 		}
 	}
 



More information about the asterisk-commits mailing list