[Asterisk-code-review] app voicemail: Cleanup mailbox topic and cache (asterisk[13])

George Joseph asteriskteam at digium.com
Thu Sep 20 10:20:41 CDT 2018


George Joseph has uploaded this change for review. ( https://gerrit.asterisk.org/10212


Change subject: app_voicemail:  Cleanup mailbox topic and cache
......................................................................

app_voicemail:  Cleanup mailbox topic and cache

app_voicemail wasn't properly cleaning up the stasis cache or the
mwi topic pool when the module was unloaded or when a user was
deleted as a result of a reload.  This resulted in leaks in both
areas.

* app_voicemail now calls ast_delete_mwi_state_full when it frees
  a user structure and ast_delete_mwi_state_full in turn now calls
  the new stasis_topic_pool_delete_topic function to clear the topic
  from the pool.

Change-Id: Ide23144a4a810e7e0faad5a8e988d15947965df8
---
M apps/app_voicemail.c
M main/app.c
2 files changed, 5 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/12/10212/1

diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index f2b6c97..813e944 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -2004,6 +2004,8 @@
 		return;
 	}
 
+	ast_delete_mwi_state_full(vmu->mailbox, vmu->context, NULL);
+
 	ast_free(vmu->email);
 	vmu->email = NULL;
 	ast_free(vmu->emailbody);
diff --git a/main/app.c b/main/app.c
index e7aab10..bc28ef6 100644
--- a/main/app.c
+++ b/main/app.c
@@ -3355,6 +3355,9 @@
 	if (clear_msg) {
 		stasis_publish(mailbox_specific_topic, clear_msg);
 	}
+
+	stasis_topic_pool_delete_topic(mwi_topic_pool, stasis_topic_name(mailbox_specific_topic));
+
 	ao2_cleanup(clear_msg);
 	return 0;
 }

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

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ide23144a4a810e7e0faad5a8e988d15947965df8
Gerrit-Change-Number: 10212
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180920/fd54fcd7/attachment.html>


More information about the asterisk-code-review mailing list