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
e3dac3eb
Commit
e3dac3eb
authored
Sep 19, 2014
by
Philip Withnall
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
agent: Factor out free function for IncomingCheck
parent
21b0fee0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
19 deletions
+16
-19
agent/component.c
agent/component.c
+11
-13
agent/component.h
agent/component.h
+3
-0
agent/conncheck.c
agent/conncheck.c
+2
-6
No files found.
agent/component.c
View file @
e3dac3eb
...
@@ -61,6 +61,13 @@ static void
...
@@ -61,6 +61,13 @@ static void
component_deschedule_io_callback
(
Component
*
component
);
component_deschedule_io_callback
(
Component
*
component
);
void
incoming_check_free
(
IncomingCheck
*
icheck
)
{
g_free
(
icheck
->
username
);
g_slice_free
(
IncomingCheck
,
icheck
);
}
/* Must *not* take the agent lock, since it’s called from within
/* Must *not* take the agent lock, since it’s called from within
* component_set_io_context(), which holds the Component’s I/O lock. */
* component_set_io_context(), which holds the Component’s I/O lock. */
static
void
static
void
...
@@ -234,18 +241,13 @@ component_close (Component *cmp)
...
@@ -234,18 +241,13 @@ component_close (Component *cmp)
nice_candidate_free
(
cmp
->
turn_candidate
),
nice_candidate_free
(
cmp
->
turn_candidate
),
cmp
->
turn_candidate
=
NULL
;
cmp
->
turn_candidate
=
NULL
;
for
(
i
=
cmp
->
incoming_checks
;
i
;
i
=
i
->
next
)
{
IncomingCheck
*
icheck
=
i
->
data
;
g_free
(
icheck
->
username
);
g_slice_free
(
IncomingCheck
,
icheck
);
}
g_slist_free
(
cmp
->
local_candidates
);
g_slist_free
(
cmp
->
local_candidates
);
cmp
->
local_candidates
=
NULL
;
cmp
->
local_candidates
=
NULL
;
g_slist_free
(
cmp
->
remote_candidates
);
g_slist_free
(
cmp
->
remote_candidates
);
cmp
->
remote_candidates
=
NULL
;
cmp
->
remote_candidates
=
NULL
;
component_free_socket_sources
(
cmp
);
component_free_socket_sources
(
cmp
);
g_slist_free
(
cmp
->
incoming_checks
);
g_slist_free_full
(
cmp
->
incoming_checks
,
(
GDestroyNotify
)
incoming_check_free
);
cmp
->
incoming_checks
=
NULL
;
cmp
->
incoming_checks
=
NULL
;
component_clean_turn_servers
(
cmp
);
component_clean_turn_servers
(
cmp
);
...
@@ -361,12 +363,8 @@ component_restart (Component *cmp)
...
@@ -361,12 +363,8 @@ component_restart (Component *cmp)
g_slist_free
(
cmp
->
remote_candidates
),
g_slist_free
(
cmp
->
remote_candidates
),
cmp
->
remote_candidates
=
NULL
;
cmp
->
remote_candidates
=
NULL
;
for
(
i
=
cmp
->
incoming_checks
;
i
;
i
=
i
->
next
)
{
g_slist_free_full
(
cmp
->
incoming_checks
,
IncomingCheck
*
icheck
=
i
->
data
;
(
GDestroyNotify
)
incoming_check_free
);
g_free
(
icheck
->
username
);
g_slice_free
(
IncomingCheck
,
icheck
);
}
g_slist_free
(
cmp
->
incoming_checks
);
cmp
->
incoming_checks
=
NULL
;
cmp
->
incoming_checks
=
NULL
;
/* note: component state managed by agent */
/* note: component state managed by agent */
...
...
agent/component.h
View file @
e3dac3eb
...
@@ -96,6 +96,9 @@ struct _IncomingCheck
...
@@ -96,6 +96,9 @@ struct _IncomingCheck
uint16_t
username_len
;
uint16_t
username_len
;
};
};
void
incoming_check_free
(
IncomingCheck
*
icheck
);
/* A pair of a socket and the GSource which polls it from the main loop. All
/* A pair of a socket and the GSource which polls it from the main loop. All
* GSources in a Component must be attached to the same main context:
* GSources in a Component must be attached to the same main context:
* component->ctx.
* component->ctx.
...
...
agent/conncheck.c
View file @
e3dac3eb
...
@@ -1123,12 +1123,8 @@ void conn_check_remote_candidates_set(NiceAgent *agent)
...
@@ -1123,12 +1123,8 @@ void conn_check_remote_candidates_set(NiceAgent *agent)
/* Once we process the pending checks, we should free them to avoid
/* Once we process the pending checks, we should free them to avoid
* reprocessing them again if a dribble-mode set_remote_candidates
* reprocessing them again if a dribble-mode set_remote_candidates
* is called */
* is called */
for
(
m
=
component
->
incoming_checks
;
m
;
m
=
m
->
next
)
{
g_slist_free_full
(
component
->
incoming_checks
,
IncomingCheck
*
icheck
=
m
->
data
;
(
GDestroyNotify
)
incoming_check_free
);
g_free
(
icheck
->
username
);
g_slice_free
(
IncomingCheck
,
icheck
);
}
g_slist_free
(
component
->
incoming_checks
);
component
->
incoming_checks
=
NULL
;
component
->
incoming_checks
=
NULL
;
}
}
}
}
...
...
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