mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
Copy callbacks list before iterating over it and calling each callbacks so we can remove a callback inside a callback call
This commit is contained in:
parent
753cb798b5
commit
247c2877a8
1 changed files with 4 additions and 2 deletions
|
|
@ -430,12 +430,14 @@ const bctbx_list_t *linphone_chat_room_get_callbacks_list(const LinphoneChatRoom
|
|||
LinphoneChatRoomCbs ## cbName ## Cb cb = linphone_chat_room_cbs_get_ ## functionName (cr->cbs); \
|
||||
if (cb) \
|
||||
cb(__VA_ARGS__); \
|
||||
for (bctbx_list_t *it = cr->callbacks; it; it = bctbx_list_next(it)) { \
|
||||
bctbx_list_t *callbacks_copy = bctbx_list_copy(cr->callbacks); \
|
||||
for (bctbx_list_t *it = callbacks_copy; it; it = bctbx_list_next(it)) { \
|
||||
cr->currentCbs = reinterpret_cast<LinphoneChatRoomCbs *>(bctbx_list_get_data(it)); \
|
||||
cb = linphone_chat_room_cbs_get_ ## functionName (cr->currentCbs); \
|
||||
if (cb) \
|
||||
cb(__VA_ARGS__); \
|
||||
}
|
||||
} \
|
||||
bctbx_free(callbacks_copy);
|
||||
|
||||
void linphone_chat_room_notify_is_composing_received(LinphoneChatRoom *cr, const LinphoneAddress *remoteAddr, bool_t isComposing) {
|
||||
NOTIFY_IF_EXIST(IsComposingReceived, is_composing_received, cr, remoteAddr, isComposing)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue