[asterisk-commits] russell: branch russell/func_devstate r54217 - /team/russell/func_devstate/fu...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Feb 13 13:38:29 MST 2007


Author: russell
Date: Tue Feb 13 14:38:28 2007
New Revision: 54217

URL: http://svn.digium.com/view/asterisk?view=rev&rev=54217
Log:
Free the custom devices on module unload

Modified:
    team/russell/func_devstate/funcs/func_devstate.c

Modified: team/russell/func_devstate/funcs/func_devstate.c
URL: http://svn.digium.com/view/asterisk/team/russell/func_devstate/funcs/func_devstate.c?view=diff&rev=54217&r1=54216&r2=54217
==============================================================================
--- team/russell/func_devstate/funcs/func_devstate.c (original)
+++ team/russell/func_devstate/funcs/func_devstate.c Tue Feb 13 14:38:28 2007
@@ -116,10 +116,16 @@
 
 static int unload_module(void)
 {
+	struct custom_device *dev;
 	int res = 0;
 
 	res |= ast_custom_function_unregister(&devstate_function);
 	ast_devstate_prov_del("Custom");
+
+	AST_RWLIST_WRLOCK(&custom_devices);
+	while ((dev = AST_RWLIST_REMOVE_HEAD(&custom_devices, entry)))
+		free(dev);
+	AST_RWLIST_UNLOCK(&custom_devices);
 
 	return res;
 }



More information about the asterisk-commits mailing list