summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
Diffstat (limited to 'res')
-rw-r--r--res/res_pjsip.c7
-rw-r--r--res/res_pjsip_history.c7
-rw-r--r--res/res_rtp_asterisk.c11
3 files changed, 22 insertions, 3 deletions
diff --git a/res/res_pjsip.c b/res/res_pjsip.c
index 9970d84f4..92dca7fb8 100644
--- a/res/res_pjsip.c
+++ b/res/res_pjsip.c
@@ -4409,8 +4409,13 @@ static int unload_pjsip(void *data)
}
if (memory_pool) {
- pj_pool_release(memory_pool);
+ /* This mimics the behavior of pj_pool_safe_release
+ * which was introduced in pjproject 2.6.
+ */
+ pj_pool_t *temp_pool = memory_pool;
+
memory_pool = NULL;
+ pj_pool_release(temp_pool);
}
ast_pjsip_endpoint = NULL;
diff --git a/res/res_pjsip_history.c b/res/res_pjsip_history.c
index 651f19dea..0b50f6817 100644
--- a/res/res_pjsip_history.c
+++ b/res/res_pjsip_history.c
@@ -608,8 +608,13 @@ static void pjsip_history_entry_dtor(void *obj)
struct pjsip_history_entry *entry = obj;
if (entry->pool) {
- pj_pool_release(entry->pool);
+ /* This mimics the behavior of pj_pool_safe_release
+ * which was introduced in pjproject 2.6.
+ */
+ pj_pool_t *temp_pool = entry->pool;
+
entry->pool = NULL;
+ pj_pool_release(temp_pool);
}
}
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index e6a65ff60..346db604c 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -1055,7 +1055,16 @@ static void rtp_ioqueue_thread_destroy(struct ast_rtp_ioqueue_thread *ioqueue)
pj_thread_destroy(ioqueue->thread);
}
- pj_pool_release(ioqueue->pool);
+ if (ioqueue->pool) {
+ /* This mimics the behavior of pj_pool_safe_release
+ * which was introduced in pjproject 2.6.
+ */
+ pj_pool_t *temp_pool = ioqueue->pool;
+
+ ioqueue->pool = NULL;
+ pj_pool_release(temp_pool);
+ }
+
ast_free(ioqueue);
}