diff options
author | Corey Farrell <git@cfware.com> | 2015-05-22 17:52:29 -0400 |
---|---|---|
committer | Corey Farrell <git@cfware.com> | 2015-05-22 17:09:47 -0500 |
commit | 5a1f2a5884c250b2c709e4fb48f06dc0dfb39553 (patch) | |
tree | bc5da52203a49dd44b5f633520a37a2ac93cedef /main/astobj2.c | |
parent | f66c41e668429b9a07dfdf30832c02ddc223f4a4 (diff) |
Astobj2: Run weakproxy subscription callbacks in reverse order.
Modify ao2_weakproxy_subscribe so each new subscription is added
to the head of the list. This ensures that when other objects
are allocated and use a subscription to the weakproxy for cleanup,
cleanup will occur in the correct order.
ASTERISK-25120 #close
Change-Id: Ie0476f08ec21330de1b3f5a2dd3d9eb683df3d3d
Diffstat (limited to 'main/astobj2.c')
-rw-r--r-- | main/astobj2.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/main/astobj2.c b/main/astobj2.c index 1db2dd42d..ed91577be 100644 --- a/main/astobj2.c +++ b/main/astobj2.c @@ -928,7 +928,7 @@ int ao2_weakproxy_subscribe(void *weakproxy, ao2_weakproxy_notification_cb cb, v if (sub) { sub->cb = cb; sub->data = data; - AST_LIST_INSERT_TAIL(&weak->destroyed_cb, sub, list); + AST_LIST_INSERT_HEAD(&weak->destroyed_cb, sub, list); ret = 0; } } else { |