[Asterisk-code-review] app voicemail: Cleanup mailbox topic and cache (asterisk[16])
George Joseph
asteriskteam at digium.com
Mon Sep 24 10:08:42 CDT 2018
George Joseph has submitted this change and it was merged. ( https://gerrit.asterisk.org/10214 )
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, 7 insertions(+), 0 deletions(-)
Approvals:
Kevin Harwell: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved
George Joseph: Approved for Submit
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index c5afb32..0e00375 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -2020,6 +2020,10 @@
return;
}
+ if (!ast_strlen_zero(vmu->mailbox)) {
+ 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 2135335..953b77d 100644
--- a/main/app.c
+++ b/main/app.c
@@ -3344,6 +3344,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/10214
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-MessageType: merged
Gerrit-Change-Id: Ide23144a4a810e7e0faad5a8e988d15947965df8
Gerrit-Change-Number: 10214
Gerrit-PatchSet: 4
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2 (1000185)
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180924/67df45de/attachment-0001.html>
More information about the asterisk-code-review
mailing list