Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libnice
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
libnice
Commits
d510f45d
Commit
d510f45d
authored
Apr 22, 2014
by
Olivier Crête
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
discovery: Use g_slist_free_full for candidate refresh list
parent
9057acc5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
11 deletions
+6
-11
agent/discovery.c
agent/discovery.c
+6
-10
agent/discovery.h
agent/discovery.h
+0
-1
No files found.
agent/discovery.c
View file @
d510f45d
...
@@ -124,11 +124,10 @@ void discovery_prune_stream (NiceAgent *agent, guint stream_id)
...
@@ -124,11 +124,10 @@ void discovery_prune_stream (NiceAgent *agent, guint stream_id)
/*
/*
* Frees the CandidateDiscovery structure pointed to
* Frees the CandidateDiscovery structure pointed to
* by 'user data'. Compatible with g_slist_f
oreach
().
* by 'user data'. Compatible with g_slist_f
ree_full
().
*/
*/
void
refresh_free_item
(
gpointer
data
,
gpointer
user_data
)
static
void
refresh_free_item
(
CandidateRefresh
*
cand
)
{
{
CandidateRefresh
*
cand
=
data
;
NiceAgent
*
agent
=
cand
->
agent
;
NiceAgent
*
agent
=
cand
->
agent
;
uint8_t
*
username
;
uint8_t
*
username
;
gsize
username_len
;
gsize
username_len
;
...
@@ -137,8 +136,6 @@ void refresh_free_item (gpointer data, gpointer user_data)
...
@@ -137,8 +136,6 @@ void refresh_free_item (gpointer data, gpointer user_data)
size_t
buffer_len
=
0
;
size_t
buffer_len
=
0
;
StunUsageTurnCompatibility
turn_compat
=
agent_to_turn_compatibility
(
agent
);
StunUsageTurnCompatibility
turn_compat
=
agent_to_turn_compatibility
(
agent
);
g_assert
(
user_data
==
NULL
);
if
(
cand
->
timer_source
!=
NULL
)
{
if
(
cand
->
timer_source
!=
NULL
)
{
g_source_destroy
(
cand
->
timer_source
);
g_source_destroy
(
cand
->
timer_source
);
g_source_unref
(
cand
->
timer_source
);
g_source_unref
(
cand
->
timer_source
);
...
@@ -200,8 +197,7 @@ void refresh_free_item (gpointer data, gpointer user_data)
...
@@ -200,8 +197,7 @@ void refresh_free_item (gpointer data, gpointer user_data)
*/
*/
void
refresh_free
(
NiceAgent
*
agent
)
void
refresh_free
(
NiceAgent
*
agent
)
{
{
g_slist_foreach
(
agent
->
refresh_list
,
refresh_free_item
,
NULL
);
g_slist_free_full
(
agent
->
refresh_list
,
(
GDestroyNotify
)
refresh_free_item
);
g_slist_free
(
agent
->
refresh_list
);
agent
->
refresh_list
=
NULL
;
agent
->
refresh_list
=
NULL
;
}
}
...
@@ -220,8 +216,8 @@ void refresh_prune_stream (NiceAgent *agent, guint stream_id)
...
@@ -220,8 +216,8 @@ void refresh_prune_stream (NiceAgent *agent, guint stream_id)
GSList
*
next
=
i
->
next
;
GSList
*
next
=
i
->
next
;
if
(
cand
->
stream
->
id
==
stream_id
)
{
if
(
cand
->
stream
->
id
==
stream_id
)
{
agent
->
refresh_list
=
g_slist_
remove
(
agent
->
refresh_list
,
cand
);
agent
->
refresh_list
=
g_slist_
delete_link
(
agent
->
refresh_list
,
i
);
refresh_free_item
(
cand
,
NULL
);
refresh_free_item
(
cand
);
}
}
i
=
next
;
i
=
next
;
...
@@ -233,7 +229,7 @@ void refresh_cancel (CandidateRefresh *refresh)
...
@@ -233,7 +229,7 @@ void refresh_cancel (CandidateRefresh *refresh)
{
{
refresh
->
agent
->
refresh_list
=
g_slist_remove
(
refresh
->
agent
->
refresh_list
,
refresh
->
agent
->
refresh_list
=
g_slist_remove
(
refresh
->
agent
->
refresh_list
,
refresh
);
refresh
);
refresh_free_item
(
refresh
,
NULL
);
refresh_free_item
(
refresh
);
}
}
/*
/*
...
...
agent/discovery.h
View file @
d510f45d
...
@@ -82,7 +82,6 @@ typedef struct
...
@@ -82,7 +82,6 @@ typedef struct
StunMessage
stun_resp_msg
;
StunMessage
stun_resp_msg
;
}
CandidateRefresh
;
}
CandidateRefresh
;
void
refresh_free_item
(
gpointer
data
,
gpointer
user_data
);
void
refresh_free
(
NiceAgent
*
agent
);
void
refresh_free
(
NiceAgent
*
agent
);
void
refresh_prune_stream
(
NiceAgent
*
agent
,
guint
stream_id
);
void
refresh_prune_stream
(
NiceAgent
*
agent
,
guint
stream_id
);
void
refresh_cancel
(
CandidateRefresh
*
refresh
);
void
refresh_cancel
(
CandidateRefresh
*
refresh
);
...
...
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