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
44b332d4
Commit
44b332d4
authored
Sep 24, 2014
by
Philip Withnall
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: Move a closure from the heap to the stack
There is no need for this to be heap-allocated.
parent
801e6f9a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
14 deletions
+10
-14
tests/test-io-stream-cancelling.c
tests/test-io-stream-cancelling.c
+10
-14
No files found.
tests/test-io-stream-cancelling.c
View file @
44b332d4
...
@@ -98,7 +98,7 @@ read_thread_cb (GInputStream *input_stream, TestIOStreamThreadData *data)
...
@@ -98,7 +98,7 @@ read_thread_cb (GInputStream *input_stream, TestIOStreamThreadData *data)
int
main
(
void
)
int
main
(
void
)
{
{
GThread
*
l_cancellation_thread
,
*
r_cancellation_thread
;
GThread
*
l_cancellation_thread
,
*
r_cancellation_thread
;
CancellationData
*
l_data
,
*
r_data
;
CancellationData
l_data
,
r_data
;
const
TestIOStreamCallbacks
callbacks
=
{
const
TestIOStreamCallbacks
callbacks
=
{
read_thread_cb
,
read_thread_cb
,
...
@@ -114,29 +114,25 @@ int main (void)
...
@@ -114,29 +114,25 @@ int main (void)
g_type_init
();
g_type_init
();
g_thread_init
(
NULL
);
g_thread_init
(
NULL
);
l_data
=
g_malloc0
(
sizeof
(
CancellationData
));
l_data
.
cancellable
=
g_cancellable_new
();
l_data
->
cancellable
=
g_cancellable_new
();
l_data
.
blocking
=
FALSE
;
l_data
->
blocking
=
FALSE
;
r_data
=
g_malloc0
(
sizeof
(
CancellationData
));
r_data
.
cancellable
=
g_cancellable_new
();
r_data
->
cancellable
=
g_cancellable_new
();
r_data
.
blocking
=
FALSE
;
r_data
->
blocking
=
FALSE
;
l_cancellation_thread
=
spawn_thread
(
"libnice L cancel"
,
l_cancellation_thread
=
spawn_thread
(
"libnice L cancel"
,
cancellation_thread_cb
,
l_data
);
cancellation_thread_cb
,
&
l_data
);
r_cancellation_thread
=
spawn_thread
(
"libnice R cancel"
,
r_cancellation_thread
=
spawn_thread
(
"libnice R cancel"
,
cancellation_thread_cb
,
r_data
);
cancellation_thread_cb
,
&
r_data
);
run_io_stream_test
(
30
,
TRUE
,
&
callbacks
,
l_data
,
NULL
,
r_data
,
NULL
);
run_io_stream_test
(
30
,
TRUE
,
&
callbacks
,
&
l_data
,
NULL
,
&
r_data
,
NULL
);
g_thread_join
(
l_cancellation_thread
);
g_thread_join
(
l_cancellation_thread
);
g_thread_join
(
r_cancellation_thread
);
g_thread_join
(
r_cancellation_thread
);
/* Free things. */
/* Free things. */
g_object_unref
(
r_data
->
cancellable
);
g_object_unref
(
r_data
.
cancellable
);
g_free
(
r_data
);
g_object_unref
(
l_data
.
cancellable
);
g_object_unref
(
l_data
->
cancellable
);
g_free
(
l_data
);
#ifdef G_OS_WIN32
#ifdef G_OS_WIN32
WSACleanup
();
WSACleanup
();
...
...
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