Commit 18f0782b authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Take a ref when creating a bctbx_list of C pointers from a std::list of shared_ptr

parent 7969616d
......@@ -367,8 +367,9 @@ public:
>
static inline bctbx_list_t *getResolvedCListFromCppList (const std::list<std::shared_ptr<CppType>> &cppList) {
bctbx_list_t *result = nullptr;
for (const auto &value : cppList)
result = bctbx_list_append(result, getCBackPtr(value));
for (const auto &value : cppList) {
result = bctbx_list_append(result, belle_sip_object_ref(getCBackPtr(value)));
}
return result;
}
......@@ -379,7 +380,7 @@ public:
static inline bctbx_list_t *getResolvedCListFromCppList (const std::list<CppType> &cppList) {
bctbx_list_t *result = nullptr;
for (const auto &value : cppList)
result = bctbx_list_append(result, getCBackPtr(value));
result = bctbx_list_append(result, belle_sip_object_ref(getCBackPtr(value)));
return result;
}
......
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