mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-19 19:20:35 +00:00
Fix lock destruction/unlock inversion
When using scoped locks, the unref of an AO2 object should happen after the unlock occurs which requires usage of scoped refs. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383377 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -91,6 +91,7 @@ static void router_dispatch(void *data,
|
||||
struct stasis_message *message)
|
||||
{
|
||||
struct stasis_message_router *router = data;
|
||||
RAII_VAR(struct stasis_message_router *, router_needs_cleanup, NULL, ao2_cleanup);
|
||||
RAII_VAR(struct stasis_message_route *, route, NULL, ao2_cleanup);
|
||||
struct stasis_message_type *type = stasis_message_type(message);
|
||||
size_t i;
|
||||
@@ -123,7 +124,7 @@ static void router_dispatch(void *data,
|
||||
}
|
||||
|
||||
if (stasis_subscription_final_message(sub, message)) {
|
||||
ao2_cleanup(router);
|
||||
router_needs_cleanup = router;
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user