Commit 15b44a2d authored by Simon Morlat's avatar Simon Morlat Committed by Simon Morlat

Fix bad usage of linphone event in list of conference subcription. In case of...

Fix bad usage of linphone event in list of conference subcription. In case of error in the subscribe transaction, the LinphoneEvent is unrefd by the core, but still pointed.
The code has to either take into account the LinphoneEvent state notifications, or take a ref.
parent 2dc7d696
...@@ -63,6 +63,7 @@ RemoteConferenceListEventHandler::~RemoteConferenceListEventHandler () { ...@@ -63,6 +63,7 @@ RemoteConferenceListEventHandler::~RemoteConferenceListEventHandler () {
void RemoteConferenceListEventHandler::subscribe () { void RemoteConferenceListEventHandler::subscribe () {
if (lev) { if (lev) {
linphone_event_terminate(lev);
linphone_event_unref(lev); linphone_event_unref(lev);
lev = nullptr; lev = nullptr;
} }
...@@ -107,6 +108,7 @@ void RemoteConferenceListEventHandler::subscribe () { ...@@ -107,6 +108,7 @@ void RemoteConferenceListEventHandler::subscribe () {
LinphoneAddress *rlsAddr = linphone_address_new(factoryUri); LinphoneAddress *rlsAddr = linphone_address_new(factoryUri);
lev = linphone_core_create_subscribe(lc, rlsAddr, "conference", 600); lev = linphone_core_create_subscribe(lc, rlsAddr, "conference", 600);
linphone_event_ref(lev);
char *from = linphone_address_as_string(linphone_proxy_config_get_contact(linphone_core_get_default_proxy_config(getCore()->getCCore()))); char *from = linphone_address_as_string(linphone_proxy_config_get_contact(linphone_core_get_default_proxy_config(getCore()->getCCore())));
lev->op->setFrom(from); lev->op->setFrom(from);
bctbx_free(from); bctbx_free(from);
...@@ -127,6 +129,7 @@ void RemoteConferenceListEventHandler::subscribe () { ...@@ -127,6 +129,7 @@ void RemoteConferenceListEventHandler::subscribe () {
void RemoteConferenceListEventHandler::unsubscribe () { void RemoteConferenceListEventHandler::unsubscribe () {
if (lev) { if (lev) {
linphone_event_terminate(lev); linphone_event_terminate(lev);
linphone_event_unref(lev);
lev = nullptr; lev = nullptr;
} }
} }
......
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