aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-06 01:16:36 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-06 01:16:36 +0000
commit794f99680480074b901838f1a457fc6b1e1f83f8 (patch)
treec15b473a112327ec1d2df0922277b2b8c572e248 /res
parent4dd57730f9e7f2fc2e1ce6c1734a25e8c633741d (diff)
Fix ao2_iterator API to hold references to containers being iterated.
See Mantis issue for details of what prompted this change. Additional notes: This patch changes the ao2_iterator API in two ways: F_AO2I_DONTLOCK has become an enum instead of a macro, with a name that fits our naming policy; also, it is now necessary to call ao2_iterator_destroy() on any iterator that has been created. Currently this only releases the reference to the container being iterated, but in the future this could also release other resources used by the iterator, if the iterator implementation changes to use additional resources. (closes issue #15987) Reported by: kpfleming Review: https://reviewboard.asterisk.org/r/383/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@222152 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r--res/res_musiconhold.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c
index 141f89c01..630a6db58 100644
--- a/res/res_musiconhold.c
+++ b/res/res_musiconhold.c
@@ -1349,6 +1349,8 @@ static int cli_files_show(int fd, int argc, char *argv[])
}
}
+ ao2_iterator_destroy(&i);
+
return 0;
}
@@ -1371,6 +1373,8 @@ static int moh_classes_show(int fd, int argc, char *argv[])
}
}
+ ao2_iterator_destroy(&i);
+
return 0;
}