[Asterisk-code-review] stasis: Improve message type "Use of before/init after destr... (asterisk[master])

George Joseph asteriskteam at digium.com
Wed Jul 18 14:07:53 CDT 2018


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

Change subject: stasis: Improve message type "Use of before/init after destruction"
......................................................................

stasis: Improve message type "Use of before/init after destruction"

Fixes issue where error msg
"Use of before/init after destruction"
was being printed on disabled messages
in dev mode.  With this
fix if message is disabled
a warning will print.

ASTERISK-25548
Change-Id: Ie0d866d1cbc60c16dbef08bc65e99505c3c1adfa
---
M main/stasis.c
1 file changed, 3 insertions(+), 1 deletion(-)

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



diff --git a/main/stasis.c b/main/stasis.c
index 190ab14..3254011 100644
--- a/main/stasis.c
+++ b/main/stasis.c
@@ -1199,7 +1199,9 @@
 void stasis_log_bad_type_access(const char *name)
 {
 #ifdef AST_DEVMODE
-	ast_log(LOG_ERROR, "Use of %s() before init/after destruction\n", name);
+	if (!stasis_message_type_declined(name)) {
+		ast_log(LOG_ERROR, "Use of %s() before init/after destruction\n", name);
+	}
 #endif
 }
 

-- 
To view, visit https://gerrit.asterisk.org/9512
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: Ie0d866d1cbc60c16dbef08bc65e99505c3c1adfa
Gerrit-Change-Number: 9512
Gerrit-PatchSet: 2
Gerrit-Owner: Chris Savinovich <csavinovich at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
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/20180718/5bf008e0/attachment.html>


More information about the asterisk-code-review mailing list