]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
astobj2: Fix shutdown order.
authorCorey Farrell <git@cfware.com>
Thu, 27 Sep 2018 10:33:22 +0000 (06:33 -0400)
committerCorey Farrell <git@cfware.com>
Thu, 27 Sep 2018 10:42:22 +0000 (05:42 -0500)
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

index 147df7aedc4a6760e44eb919dd57eaaf141d8651..825c3c8e61446aa3bbefaccc74e2e1cc3ad98dd4 100644 (file)
@@ -887,8 +887,11 @@ int astobj2_init(void)
        }
 #endif
 
+       ast_register_cleanup(astobj2_cleanup);
+
        if (container_init() != 0) {
                fclose(ref_log);
+               ref_log = NULL;
                return -1;
        }
 
@@ -896,7 +899,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;
 }