linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linphone-developers] Patch to belle-sip to fix channel.c reference coun


From: Trevor Alpeter
Subject: [Linphone-developers] Patch to belle-sip to fix channel.c reference counting of SIP stack
Date: Fri, 15 Jul 2016 14:54:04 -0400

Hello,

Attached is a patch for the belle-sip library that updates channel.c to
increment the SIP stack reference count when a channel is created and
decrement it when a channel is destroyed.

This is necessary because the channel object retains a reference to the
stack and a segfault can occur if the stack is destroyed before the channel.

This problem is particularly apparent on Android as the JVM retains
references to LinphoneEvent JNI objects, at least one of which
indirectly references a channel once the app has successfully
registered. The app calls LinphoneCore.destroy() when it exits, which
destroys the SIP stack. The JVM subsequently performs a garbage
collection releasing the LinphoneEvent objects and causing the channel
to be destroyed and generating a segfault.

With this patch, the stack is not destroyed until after the channel and
no segfault occurs.

Thanks.

Trevor



Attachment: channel_refcount_stack.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]