[Asterisk-code-review] astobj2: Fix shutdown order. (asterisk[master])

George Joseph asteriskteam at digium.com
Fri Sep 28 08:38:31 CDT 2018


George Joseph has submitted this change and it was merged. ( https://gerrit.asterisk.org/10295 )

Change subject: astobj2: Fix shutdown order.
......................................................................

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
---
M main/astobj2.c
1 file changed, 3 insertions(+), 2 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  Richard Mudgett: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved; Approved for Submit



diff --git a/main/astobj2.c b/main/astobj2.c
index 63058e1..91ebc1e 100644
--- a/main/astobj2.c
+++ b/main/astobj2.c
@@ -1193,8 +1193,11 @@
 		}
 	}
 
+	ast_register_cleanup(astobj2_cleanup);
+
 	if (container_init() != 0) {
 		fclose(ref_log);
+		ref_log = NULL;
 		return -1;
 	}
 
@@ -1202,7 +1205,5 @@
 	ast_cli_register_multiple(cli_astobj2, ARRAY_LEN(cli_astobj2));
 #endif	/* defined(AO2_DEBUG) */
 
-	ast_register_cleanup(astobj2_cleanup);
-
 	return 0;
 }

-- 
To view, visit https://gerrit.asterisk.org/10295
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: If9111c4c21c68064b22c546d5d7a41fac430430e
Gerrit-Change-Number: 10295
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2 (1000185)
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180928/fc426c99/attachment.html>


More information about the asterisk-code-review mailing list