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
5aa81a86
Commit
5aa81a86
authored
Sep 20, 2011
by
Olivier Crête
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Keep a ref on the GMainContext that are attached to
parent
a41f0d63
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
6 deletions
+17
-6
agent/agent.c
agent/agent.c
+8
-5
agent/component.c
agent/component.c
+5
-0
socket/tcp-bsd.c
socket/tcp-bsd.c
+4
-1
No files found.
agent/agent.c
View file @
5aa81a86
...
@@ -2733,10 +2733,18 @@ nice_agent_attach_recv (
...
@@ -2733,10 +2733,18 @@ nice_agent_attach_recv (
ret
=
TRUE
;
ret
=
TRUE
;
component
->
g_source_io_cb
=
NULL
;
component
->
data
=
NULL
;
if
(
component
->
ctx
)
g_main_context_unref
(
component
->
ctx
);
component
->
ctx
=
NULL
;
if
(
func
)
{
if
(
func
)
{
component
->
g_source_io_cb
=
func
;
component
->
g_source_io_cb
=
func
;
component
->
data
=
data
;
component
->
data
=
data
;
component
->
ctx
=
ctx
;
component
->
ctx
=
ctx
;
if
(
ctx
)
g_main_context_ref
(
ctx
);
priv_attach_stream_component
(
agent
,
stream
,
component
);
priv_attach_stream_component
(
agent
,
stream
,
component
);
...
@@ -2749,13 +2757,8 @@ nice_agent_attach_recv (
...
@@ -2749,13 +2757,8 @@ nice_agent_attach_recv (
if
(
component
->
tcp
&&
component
->
tcp_data
&&
component
->
tcp_readable
)
if
(
component
->
tcp
&&
component
->
tcp_data
&&
component
->
tcp_readable
)
pseudo_tcp_socket_readable
(
component
->
tcp
,
component
->
tcp_data
);
pseudo_tcp_socket_readable
(
component
->
tcp
,
component
->
tcp_data
);
}
else
{
component
->
g_source_io_cb
=
NULL
;
component
->
data
=
NULL
;
component
->
ctx
=
NULL
;
}
}
done:
done:
agent_unlock
();
agent_unlock
();
return
ret
;
return
ret
;
...
...
agent/component.c
View file @
5aa81a86
...
@@ -140,6 +140,11 @@ component_free (Component *cmp)
...
@@ -140,6 +140,11 @@ component_free (Component *cmp)
cmp
->
tcp_data
=
NULL
;
cmp
->
tcp_data
=
NULL
;
}
}
if
(
cmp
->
ctx
!=
NULL
)
{
g_main_context_unref
(
cmp
->
ctx
);
cmp
->
ctx
=
NULL
;
}
g_slice_free
(
Component
,
cmp
);
g_slice_free
(
Component
,
cmp
);
}
}
...
...
socket/tcp-bsd.c
View file @
5aa81a86
...
@@ -164,7 +164,7 @@ nice_tcp_bsd_socket_new (NiceAgent *agent, GMainContext *ctx, NiceAddress *addr)
...
@@ -164,7 +164,7 @@ nice_tcp_bsd_socket_new (NiceAgent *agent, GMainContext *ctx, NiceAddress *addr)
sock
->
priv
=
priv
=
g_slice_new0
(
TcpPriv
);
sock
->
priv
=
priv
=
g_slice_new0
(
TcpPriv
);
priv
->
agent
=
agent
;
priv
->
agent
=
agent
;
priv
->
context
=
ctx
;
priv
->
context
=
g_main_context_ref
(
ctx
)
;
priv
->
server_addr
=
*
addr
;
priv
->
server_addr
=
*
addr
;
priv
->
error
=
FALSE
;
priv
->
error
=
FALSE
;
...
@@ -197,6 +197,9 @@ socket_close (NiceSocket *sock)
...
@@ -197,6 +197,9 @@ socket_close (NiceSocket *sock)
g_queue_foreach
(
&
priv
->
send_queue
,
(
GFunc
)
free_to_be_sent
,
NULL
);
g_queue_foreach
(
&
priv
->
send_queue
,
(
GFunc
)
free_to_be_sent
,
NULL
);
g_queue_clear
(
&
priv
->
send_queue
);
g_queue_clear
(
&
priv
->
send_queue
);
if
(
priv
->
context
)
g_main_context_unref
(
priv
->
context
);
g_slice_free
(
TcpPriv
,
sock
->
priv
);
g_slice_free
(
TcpPriv
,
sock
->
priv
);
}
}
...
...
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