From 39bf9881e0569967c018ab564f881cfa113ba62a Mon Sep 17 00:00:00 2001 From: Corey Farrell Date: Thu, 27 Sep 2018 06:33:22 -0400 Subject: [PATCH] astobj2: Fix shutdown order. When REF_DEBUG and AO2_DEBUG are both enabled we closed the refs log before we shutdown astobj2_container. This caused the AO2_DEBUG container registration container to be reported as a leak. Change-Id: If9111c4c21c68064b22c546d5d7a41fac430430e --- main/astobj2.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main/astobj2.c b/main/astobj2.c index 63058e19e3..91ebc1e2c9 100644 --- a/main/astobj2.c +++ b/main/astobj2.c @@ -1193,8 +1193,11 @@ int astobj2_init(void) } } + ast_register_cleanup(astobj2_cleanup); + if (container_init() != 0) { fclose(ref_log); + ref_log = NULL; return -1; } @@ -1202,7 +1205,5 @@ int astobj2_init(void) ast_cli_register_multiple(cli_astobj2, ARRAY_LEN(cli_astobj2)); #endif /* defined(AO2_DEBUG) */ - ast_register_cleanup(astobj2_cleanup); - return 0; }