Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
0d5af07a
Commit
0d5af07a
authored
Jun 10, 2014
by
Simon Morlat
Browse files
fix memory leaks
parent
10d1411f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
50 additions
and
16 deletions
+50
-16
coreapi/bellesip_sal/sal_impl.c
coreapi/bellesip_sal/sal_impl.c
+5
-3
coreapi/bellesip_sal/sal_op_call.c
coreapi/bellesip_sal/sal_op_call.c
+1
-0
coreapi/bellesip_sal/sal_op_impl.c
coreapi/bellesip_sal/sal_op_impl.c
+1
-1
coreapi/callbacks.c
coreapi/callbacks.c
+5
-1
coreapi/event.c
coreapi/event.c
+18
-2
tester/call_tester.c
tester/call_tester.c
+17
-7
tester/message_tester.c
tester/message_tester.c
+3
-2
No files found.
coreapi/bellesip_sal/sal_impl.c
View file @
0d5af07a
...
...
@@ -97,14 +97,13 @@ void sal_disable_logs() {
void
sal_add_pending_auth
(
Sal
*
sal
,
SalOp
*
op
){
if
(
ms_list_find
(
sal
->
pending_auths
,
op
)
==
NULL
){
sal
->
pending_auths
=
ms_list_append
(
sal
->
pending_auths
,
sal_op_ref
(
op
)
);
sal
->
pending_auths
=
ms_list_append
(
sal
->
pending_auths
,
op
);
}
}
void
sal_remove_pending_auth
(
Sal
*
sal
,
SalOp
*
op
){
if
(
ms_list_find
(
sal
->
pending_auths
,
op
)){
sal
->
pending_auths
=
ms_list_remove
(
sal
->
pending_auths
,
op
);
sal_op_unref
(
op
);
}
}
...
...
@@ -157,7 +156,10 @@ void sal_process_authentication(SalOp *op) {
}
}
/*always store auth info, for case of wrong credential*/
if
(
op
->
auth_info
)
sal_auth_info_delete
(
op
->
auth_info
);
if
(
op
->
auth_info
)
{
sal_auth_info_delete
(
op
->
auth_info
);
op
->
auth_info
=
NULL
;
}
if
(
auth_list
){
auth_event
=
(
belle_sip_auth_event_t
*
)(
auth_list
->
data
);
op
->
auth_info
=
sal_auth_info_create
(
auth_event
);
...
...
coreapi/bellesip_sal/sal_op_call.c
View file @
0d5af07a
...
...
@@ -167,6 +167,7 @@ static void cancelling_invite(SalOp* op ){
sal_op_send_request
(
op
,
cancel
);
op
->
state
=
SalOpStateTerminating
;
}
static
int
vfu_retry
(
void
*
user_data
,
unsigned
int
events
)
{
SalOp
*
op
=
(
SalOp
*
)
user_data
;
sal_call_send_vfu_request
(
op
);
...
...
coreapi/bellesip_sal/sal_op_impl.c
View file @
0d5af07a
...
...
@@ -44,8 +44,8 @@ void sal_op_release(SalOp *op){
void
sal_op_release_impl
(
SalOp
*
op
){
ms_message
(
"Destroying op [%p] of type [%s]"
,
op
,
sal_op_type_to_string
(
op
->
type
));
if
(
op
->
pending_auth_transaction
)
belle_sip_object_unref
(
op
->
pending_auth_transaction
);
sal_remove_pending_auth
(
op
->
base
.
root
,
op
);
if
(
op
->
auth_info
)
{
sal_remove_pending_auth
(
op
->
base
.
root
,
op
);
sal_auth_info_delete
(
op
->
auth_info
);
}
if
(
op
->
sdp_answer
)
belle_sip_object_unref
(
op
->
sdp_answer
);
...
...
coreapi/callbacks.c
View file @
0d5af07a
...
...
@@ -817,7 +817,11 @@ static void call_released(SalOp *op){
LinphoneCall
*
call
=
(
LinphoneCall
*
)
sal_op_get_user_pointer
(
op
);
if
(
call
!=
NULL
){
linphone_call_set_state
(
call
,
LinphoneCallReleased
,
"Call released"
);
}
else
ms_error
(
"call_released() for already destroyed call ?"
);
}
else
{
/*we can arrive here when the core manages call at Sal level without creating a LinphoneCall object. Typicially:
* - when declining an incoming call with busy because maximum number of calls is reached.
*/
}
}
static
void
auth_failure
(
SalOp
*
op
,
SalAuthInfo
*
info
)
{
...
...
coreapi/event.c
View file @
0d5af07a
...
...
@@ -79,12 +79,15 @@ static LinphoneEvent *linphone_event_new_with_op_base(LinphoneCore *lc, SalOp *o
lev
->
is_out_of_dialog_op
=
is_out_of_dialog
;
return
lev
;
}
LinphoneEvent
*
linphone_event_new_with_op
(
LinphoneCore
*
lc
,
SalOp
*
op
,
LinphoneSubscriptionDir
dir
,
const
char
*
name
)
{
return
linphone_event_new_with_op_base
(
lc
,
op
,
dir
,
name
,
FALSE
);
}
LinphoneEvent
*
linphone_event_new_with_out_of_dialog_op
(
LinphoneCore
*
lc
,
SalOp
*
op
,
LinphoneSubscriptionDir
dir
,
const
char
*
name
)
{
return
linphone_event_new_with_op_base
(
lc
,
op
,
dir
,
name
,
TRUE
);
}
void
linphone_event_set_state
(
LinphoneEvent
*
lev
,
LinphoneSubscriptionState
state
){
LinphoneCore
*
lc
=
lev
->
lc
;
if
(
lev
->
subscription_state
!=
state
){
...
...
@@ -107,9 +110,22 @@ void linphone_event_set_publish_state(LinphoneEvent *lev, LinphonePublishState s
if
(
lc
->
vtable
.
publish_state_changed
){
lc
->
vtable
.
publish_state_changed
(
lev
->
lc
,
lev
,
state
);
}
if
(
state
==
LinphonePublishCleared
){
linphone_event_unref
(
lev
);
switch
(
state
){
case
LinphonePublishCleared
:
linphone_event_unref
(
lev
);
break
;
case
LinphonePublishOk
:
case
LinphonePublishError
:
if
(
lev
->
expires
==-
1
)
linphone_event_unref
(
lev
);
break
;
case
LinphonePublishNone
:
case
LinphonePublishProgress
:
case
LinphonePublishExpiring
:
/*nothing special to do*/
break
;
}
}
}
...
...
tester/call_tester.c
View file @
0d5af07a
...
...
@@ -246,14 +246,24 @@ static void end_call(LinphoneCoreManager *m1, LinphoneCoreManager *m2){
}
static
void
simple_call
(
void
)
{
LinphoneCoreManager
*
marie
=
linphone_core_manager_new
(
"marie_rc"
);
LinphoneCoreManager
*
pauline
=
linphone_core_manager_new
(
"pauline_rc"
);
belle_sip_object_enable_leak_detector
(
TRUE
);
int
begin
=
belle_sip_object_get_object_count
();
int
leaked_objects
;
{
LinphoneCoreManager
*
marie
=
linphone_core_manager_new
(
"marie_rc"
);
LinphoneCoreManager
*
pauline
=
linphone_core_manager_new
(
"pauline_rc"
);
CU_ASSERT_TRUE
(
call
(
pauline
,
marie
));
liblinphone_tester_check_rtcp
(
marie
,
pauline
);
end_call
(
marie
,
pauline
);
linphone_core_manager_destroy
(
marie
);
linphone_core_manager_destroy
(
pauline
);
CU_ASSERT_TRUE
(
call
(
pauline
,
marie
));
liblinphone_tester_check_rtcp
(
marie
,
pauline
);
end_call
(
marie
,
pauline
);
linphone_core_manager_destroy
(
marie
);
linphone_core_manager_destroy
(
pauline
);
}
leaked_objects
=
belle_sip_object_get_object_count
()
-
begin
;
CU_ASSERT_TRUE
(
leaked_objects
==
0
);
if
(
leaked_objects
>
0
){
belle_sip_object_dump_active_objects
();
}
}
static
void
call_with_specified_codec_bitrate
(
void
)
{
...
...
tester/message_tester.c
View file @
0d5af07a
...
...
@@ -28,7 +28,7 @@
#endif
static
char
*
message_external_body_url
;
static
char
*
message_external_body_url
=
NULL
;
void
text_message_received
(
LinphoneCore
*
lc
,
LinphoneChatRoom
*
room
,
const
LinphoneAddress
*
from_address
,
const
char
*
message
)
{
stats
*
counters
=
get_stats
(
lc
);
...
...
@@ -52,7 +52,8 @@ void message_received(LinphoneCore *lc, LinphoneChatRoom *room, LinphoneChatMess
linphone_chat_message_start_file_download
(
message
);
}
else
if
(
linphone_chat_message_get_external_body_url
(
message
))
{
counters
->
number_of_LinphoneMessageExtBodyReceived
++
;
CU_ASSERT_STRING_EQUAL
(
linphone_chat_message_get_external_body_url
(
message
),
message_external_body_url
);
if
(
message_external_body_url
)
CU_ASSERT_STRING_EQUAL
(
linphone_chat_message_get_external_body_url
(
message
),
message_external_body_url
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment