Commit 5a46392c authored by François Grisez's avatar François Grisez

Fix memory leak in C++ wrapper

parent 54cb45b2
......@@ -1584,7 +1584,7 @@ LINPHONE_PUBLIC bctbx_list_t *linphone_core_get_audio_payload_types(LinphoneCore
* @param[in] lc The core.
* @param[in] payload_types \bctbx_list{LinphonePayloadType} The new list of payload types. The core does not take
* ownership on it.
* @ingroup media_paremeters
* @ingroup media_parameters
*/
LINPHONE_PUBLIC void linphone_core_set_audio_payload_types(LinphoneCore *lc, const bctbx_list_t *payload_types);
......
......@@ -58,6 +58,11 @@ namespace linphone {
}
return cppList;
}
static std::list<std::shared_ptr<T>> bctbxListToCppList(::bctbx_list_t *bctbxList) {
std::list<std::shared_ptr<T>> cppList = bctbxListToCppList((const ::bctbx_list_t *)bctbxList);
bctbx_list_free(bctbxList);
return cppList;
}
static ::bctbx_list_t *cppListToBctbxList(const std::list<std::shared_ptr<T> > &cppList) {
bctbx_list_t *cList = NULL;
for(auto it=cppList.cbegin(); it!=cppList.cend(); it++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment