mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
event.c: fix crash with event beeing freed twice in case of error
This commit is contained in:
parent
b58f81dbea
commit
046184b541
1 changed files with 10 additions and 0 deletions
|
|
@ -332,7 +332,17 @@ const char* linphone_event_get_custom_header(LinphoneEvent* ev, const char* name
|
|||
|
||||
|
||||
void linphone_event_terminate(LinphoneEvent *lev){
|
||||
// if event was already terminated (including on error), we should not terminate it again
|
||||
// otherwise it will be unreffed twice.
|
||||
if (lev->publish_state == LinphonePublishError || lev->publish_state == LinphoneSubscriptionTerminated) {
|
||||
return;
|
||||
}
|
||||
if (lev->subscription_state == LinphoneSubscriptionError || lev->subscription_state == LinphoneSubscriptionTerminated) {
|
||||
return;
|
||||
}
|
||||
|
||||
lev->terminating=TRUE;
|
||||
|
||||
if (lev->dir==LinphoneSubscriptionIncoming){
|
||||
sal_notify_close(lev->op);
|
||||
}else if (lev->dir==LinphoneSubscriptionOutgoing){
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue