add missing ref causing crash in Java when core is destroyed before Java account creator.

This commit is contained in:
Jehan Monnier 2018-04-30 16:48:31 +02:00
parent 0681882431
commit 1801bce2eb
2 changed files with 9 additions and 3 deletions

View file

@ -243,8 +243,12 @@ void linphone_account_creator_cbs_set_update_account(LinphoneAccountCreatorCbs *
static void _linphone_account_creator_destroy(LinphoneAccountCreator *creator) {
/*this will drop all pending requests if any*/
if (creator->xmlrpc_session) linphone_xml_rpc_session_release(creator->xmlrpc_session);
if (creator->service != NULL && linphone_account_creator_service_get_destructor_cb(creator->service) != NULL)
linphone_account_creator_service_get_destructor_cb(creator->service)(creator);
if (creator->service != NULL ) {
if (linphone_account_creator_service_get_destructor_cb(creator->service) != NULL)
linphone_account_creator_service_get_destructor_cb(creator->service)(creator);
linphone_account_creator_service_unref(creator->service);
}
linphone_account_creator_cbs_unref(creator->cbs);
linphone_proxy_config_unref(creator->proxy_cfg);
linphone_account_creator_reset(creator);
@ -264,6 +268,7 @@ LinphoneAccountCreator * _linphone_account_creator_new(LinphoneCore *core, const
const char* domain = lp_config_get_string(core->config, "assistant", "domain", NULL);
creator = belle_sip_object_new(LinphoneAccountCreator);
creator->service = linphone_core_get_account_creator_service(core);
linphone_account_creator_service_ref(creator->service);
creator->cbs = linphone_account_creator_cbs_new();
creator->core = core;
creator->transport = LinphoneTransportTcp;

View file

@ -61,8 +61,9 @@ static void local_username_too_short(void) {
LinphoneAccountCreatorUsernameStatus,
"%i");
linphone_account_creator_unref(creator);
linphone_core_manager_destroy(marie);
linphone_account_creator_unref(creator);
}
static void local_username_too_long(void) {