diff options
author | Joshua Colp <jcolp@digium.com> | 2017-02-24 12:49:07 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-02-24 12:49:07 -0600 |
commit | e4ba07f1a6a2094adac13df92d0ed1ef76cf8f04 (patch) | |
tree | 12cffd4f905e8f636ff29c8bae572de2b6981047 /res | |
parent | 6ac33bfe3ed9c34ac3baf74586d5a2f44615b116 (diff) | |
parent | a537dae6d0a20ead92a9fce08ac6aeef342d91b7 (diff) |
Merge "pjproject_bundled: Update for pjproject 2.6"
Diffstat (limited to 'res')
-rw-r--r-- | res/res_pjsip.c | 7 | ||||
-rw-r--r-- | res/res_pjsip_history.c | 7 | ||||
-rw-r--r-- | res/res_rtp_asterisk.c | 11 |
3 files changed, 22 insertions, 3 deletions
diff --git a/res/res_pjsip.c b/res/res_pjsip.c index 4dead21f5..9782cc997 100644 --- a/res/res_pjsip.c +++ b/res/res_pjsip.c @@ -4448,8 +4448,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 853ba319e..4e7dbd007 100644 --- a/res/res_pjsip_history.c +++ b/res/res_pjsip_history.c @@ -606,8 +606,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 5d7adcd43..28ddeca42 100644 --- a/res/res_rtp_asterisk.c +++ b/res/res_rtp_asterisk.c @@ -1053,7 +1053,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); } |