diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-11-30 19:26:04 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-11-30 19:26:04 +0000 |
commit | 213a686818ae3b52921ac398852d0ffdff4f5f73 (patch) | |
tree | 9cb3c976f72d1999221cfb9a689ea8d7929fa8ad /main/manager.c | |
parent | 64fb113167810bc0f1d1310f205d23b687ef8f18 (diff) |
Change the behavior of ao2_link(). Previously, in inherited a reference.
Now, it automatically increases the reference count to reflect the reference
that is now held by the container.
This was done to be more consistent with ao2_unlink(), which automatically
releases the reference held by the container. It also makes it so it is
no longer possible for a pointer to be invalid after ao2_link() returns.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@90348 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/manager.c')
-rw-r--r-- | main/manager.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/main/manager.c b/main/manager.c index cecb2ca89..830634792 100644 --- a/main/manager.c +++ b/main/manager.c @@ -394,8 +394,6 @@ static char *xml_translate(char *in, struct ast_variable *vars) vc = ao2_alloc(sizeof(*vc), NULL); vc->varname = var; vc->count = 1; - /* Increment refcount, because we're going to deref once later */ - ao2_ref(vc, 1); ao2_link(vco, vc); } |