[asterisk-commits] rmudgett: branch rmudgett/parking r329202 - /team/rmudgett/parking/main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 21 12:42:17 CDT 2011


Author: rmudgett
Date: Thu Jul 21 12:42:14 2011
New Revision: 329202

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=329202
Log:
Comments and simplify parkinglot_unref().

Modified:
    team/rmudgett/parking/main/features.c

Modified: team/rmudgett/parking/main/features.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/parking/main/features.c?view=diff&rev=329202&r1=329201&r2=329202
==============================================================================
--- team/rmudgett/parking/main/features.c (original)
+++ team/rmudgett/parking/main/features.c Thu Jul 21 12:42:14 2011
@@ -4408,6 +4408,7 @@
 	struct pollfd *pfds = NULL, *new_pfds = NULL;
 	int nfds = 0, new_nfds = 0;
 
+/* BUGBUG we should see about asterisk graceful shutdown of parked calls. */
 	for (;;) {
 		struct ao2_iterator iter;
 		struct ast_parkinglot *curlot;
@@ -4765,16 +4766,13 @@
 }
 
 /*!
- * \brief Unreference parkinglot object. If no more references,
- * then go ahead and delete it
+ * \brief Unreference parkinglot object.
  */
 static void parkinglot_unref(struct ast_parkinglot *parkinglot) 
 {
-	int refcount;
-
-	refcount = ao2_ref(parkinglot, +1);
-	ast_debug(3, "Multiparking: %s refcount now %d\n", parkinglot->name, refcount - 1);
-	ao2_ref(parkinglot, -2);
+	ast_debug(3, "Multiparking: %s refcount now %d\n", parkinglot->name,
+		ao2_ref(parkinglot, 0) - 1);
+	ao2_ref(parkinglot, -1);
 }
 
 static struct ast_parkinglot *parkinglot_addref(struct ast_parkinglot *parkinglot)
@@ -4792,6 +4790,7 @@
 	struct ast_parkinglot *doomed = obj;
 	struct ast_context *con;
 
+/* BUGBUG cannot destroy context here since we don't know if it is in use by other parking lots. */
 	con = ast_context_find(doomed->cfg.parking_con);
 	if (con) {
 		ast_context_destroy(con, registrar);
@@ -5388,7 +5387,6 @@
 	struct ast_flags config_flags = { 0 };
 #endif
 	struct ast_config *cfg;
-	int res;
 
 	if (!default_parkinglot) {
 		/* Must create the default parking lot */
@@ -5416,7 +5414,7 @@
 /* BUGBUG build old contexts and extens usage list. */
 
 	ao2_t_callback(parkinglots, OBJ_NODATA, parkinglot_markall_cb, NULL, "callback to mark all parkinglots");
-	res = process_config(cfg);
+	process_config(cfg);
 	ast_config_destroy(cfg);
 	ao2_t_callback(parkinglots, OBJ_NODATA | OBJ_UNLINK, parkinglot_is_marked_cb, NULL, "callback to remove marked parkinglots");
 
@@ -5425,7 +5423,7 @@
 /* BUGBUG Destroy old and new contexts and extens usage lists. */
 /* BUGBUG Populate dialplan with new contexts and extens. */
 
-	return res;
+	return 0;
 }
 
 /*!




More information about the asterisk-commits mailing list