From 794f99680480074b901838f1a457fc6b1e1f83f8 Mon Sep 17 00:00:00 2001 From: kpfleming Date: Tue, 6 Oct 2009 01:16:36 +0000 Subject: 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 --- res/res_musiconhold.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'res') 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; } -- cgit v1.2.3