[asterisk-commits] file: branch file/bridging r107003 - /team/file/bridging/apps/app_confbridge.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Mar 8 14:30:32 CST 2008


Author: file
Date: Sat Mar  8 14:30:31 2008
New Revision: 107003

URL: http://svn.digium.com/view/asterisk?view=rev&rev=107003
Log:
Always initialize/cleanup the features structure, and bit more doxygen.

Modified:
    team/file/bridging/apps/app_confbridge.c

Modified: team/file/bridging/apps/app_confbridge.c
URL: http://svn.digium.com/view/asterisk/team/file/bridging/apps/app_confbridge.c?view=diff&rev=107003&r1=107002&r2=107003
==============================================================================
--- team/file/bridging/apps/app_confbridge.c (original)
+++ team/file/bridging/apps/app_confbridge.c Sat Mar  8 14:30:31 2008
@@ -294,6 +294,7 @@
 	return res;
 }
 
+/*! \brief The ConfBridge application */
 static int app_exec(struct ast_channel *chan, void *data)
 {
 	int res = 0;
@@ -327,9 +328,11 @@
 		return -1;
 	}
 
+	/* Always initialize the features structure, we are in most cases always going to need it. */
+	ast_bridge_features_init(&features);
+
 	/* If the menu option is enabled provide a user or admin menu as a custom feature hook */
 	if (ast_test_flag(&conference_bridge_user.flags, OPTION_MENU)) {
-		ast_bridge_features_init(&features);
 		ast_bridge_features_hook(&features, "#", menu_callback, &conference_bridge_user);
 	}
 
@@ -340,9 +343,7 @@
 	leave_conference_bridge(conference_bridge, &conference_bridge_user);
 
 	/* Can't forget to clean up the features structure, or else we risk a memory leak */
-	if (ast_test_flag(&conference_bridge_user.flags, OPTION_MENU)) {
-		ast_bridge_features_cleanup(&features);
-	}
+	ast_bridge_features_cleanup(&features);
 
 	/* If the user was kicked from the conference play back the audio prompt for it */
 	if (conference_bridge_user.kicked) {
@@ -354,11 +355,13 @@
 	return res;
 }
 
+/*! \brief Called when module is being unloaded */
 static int unload_module(void)
 {
 	return ast_unregister_application(app);
 }
 
+/*! \brief Called when module is being loaded */
 static int load_module(void)
 {
 	if (ast_register_application(app, app_exec, synopsis, descrip))




More information about the asterisk-commits mailing list