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
4441eea8
Commit
4441eea8
authored
Sep 23, 2014
by
Philip Withnall
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
agent: Use g_slist_free_full() to reduce code
This introduces no functional changes.
parent
67392282
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
23 deletions
+6
-23
agent/component.c
agent/component.c
+4
-13
agent/stream.c
agent/stream.c
+2
-10
No files found.
agent/component.c
View file @
4441eea8
...
@@ -225,20 +225,9 @@ component_clear_selected_pair (Component *component)
...
@@ -225,20 +225,9 @@ component_clear_selected_pair (Component *component)
void
void
component_close
(
Component
*
cmp
)
component_close
(
Component
*
cmp
)
{
{
GSList
*
i
;
IOCallbackData
*
data
;
IOCallbackData
*
data
;
GOutputVector
*
vec
;
GOutputVector
*
vec
;
for
(
i
=
cmp
->
local_candidates
;
i
;
i
=
i
->
next
)
{
NiceCandidate
*
candidate
=
i
->
data
;
nice_candidate_free
(
candidate
);
}
for
(
i
=
cmp
->
remote_candidates
;
i
;
i
=
i
->
next
)
{
NiceCandidate
*
candidate
=
i
->
data
;
nice_candidate_free
(
candidate
);
}
if
(
cmp
->
restart_candidate
)
if
(
cmp
->
restart_candidate
)
nice_candidate_free
(
cmp
->
restart_candidate
),
nice_candidate_free
(
cmp
->
restart_candidate
),
cmp
->
restart_candidate
=
NULL
;
cmp
->
restart_candidate
=
NULL
;
...
@@ -247,9 +236,11 @@ component_close (Component *cmp)
...
@@ -247,9 +236,11 @@ component_close (Component *cmp)
nice_candidate_free
(
cmp
->
turn_candidate
),
nice_candidate_free
(
cmp
->
turn_candidate
),
cmp
->
turn_candidate
=
NULL
;
cmp
->
turn_candidate
=
NULL
;
g_slist_free
(
cmp
->
local_candidates
);
g_slist_free_full
(
cmp
->
local_candidates
,
(
GDestroyNotify
)
nice_candidate_free
);
cmp
->
local_candidates
=
NULL
;
cmp
->
local_candidates
=
NULL
;
g_slist_free
(
cmp
->
remote_candidates
);
g_slist_free_full
(
cmp
->
remote_candidates
,
(
GDestroyNotify
)
nice_candidate_free
);
cmp
->
remote_candidates
=
NULL
;
cmp
->
remote_candidates
=
NULL
;
component_free_socket_sources
(
cmp
);
component_free_socket_sources
(
cmp
);
g_slist_free_full
(
cmp
->
incoming_checks
,
g_slist_free_full
(
cmp
->
incoming_checks
,
...
...
agent/stream.c
View file @
4441eea8
...
@@ -80,16 +80,8 @@ stream_close (Stream *stream)
...
@@ -80,16 +80,8 @@ stream_close (Stream *stream)
void
void
stream_free
(
Stream
*
stream
)
stream_free
(
Stream
*
stream
)
{
{
GSList
*
i
;
g_free
(
stream
->
name
);
g_slist_free_full
(
stream
->
components
,
(
GDestroyNotify
)
component_free
);
if
(
stream
->
name
)
g_free
(
stream
->
name
);
for
(
i
=
stream
->
components
;
i
;
i
=
i
->
next
)
{
Component
*
component
=
i
->
data
;
component_free
(
component
);
i
->
data
=
NULL
;
}
g_slist_free
(
stream
->
components
);
g_slice_free
(
Stream
,
stream
);
g_slice_free
(
Stream
,
stream
);
}
}
...
...
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