Fix ao2_callback when both OBJ_MULTIPLE and OBJ_NODATA are passed.
authorSean Bright <sean@malleable.com>
Mon, 11 Jan 2010 16:40:23 +0000 (16:40 +0000)
committerSean Bright <sean@malleable.com>
Mon, 11 Jan 2010 16:40:23 +0000 (16:40 +0000)
commitba6201cae604be1fc5eb270784ffd21a7aa45d07
treef3011a4d5524165c3aebe8ac15b9c42c2eef83d3
parent1ad299911278142389f7fe8cc6df006f9e8d3d1c
Fix ao2_callback when both OBJ_MULTIPLE and OBJ_NODATA are passed.

There is an issue which only affects trunk and the new ao2_callback OBJ_MULTIPLE
implementation.  When both OBJ_MULTIPLE and OBJ_NODATA are passed, only the first
object is visited, regardless of what is returned by the specified callback. This
causes a problem when we are clearing a container, i.e.:

    ao2_callback(container, OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE, NULL, NULL);

Only unlinks the first object.  This patch resolves this.

(closes issue #16564)
Reported by: pj
Patches:
      issue16564_20100111.diff uploaded by seanbright (license 71)
Tested by: pj, seanbright

Review: https://reviewboard.asterisk.org/r/457/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@239113 65c4cc65-6c06-0410-ace0-fbb531ad65f3
main/astobj2.c