Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
videolan
vlc
Commits
ae97a5a6
Commit
ae97a5a6
authored
Jul 09, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remoteosd: fix update thread leak
parent
b3282523
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
6 deletions
+20
-6
modules/video_filter/remoteosd.c
modules/video_filter/remoteosd.c
+20
-6
No files found.
modules/video_filter/remoteosd.c
View file @
ae97a5a6
...
@@ -570,11 +570,24 @@ static int write_update_request(filter_t *p_filter, bool incremental)
...
@@ -570,11 +570,24 @@ static int write_update_request(filter_t *p_filter, bool incremental)
return
w
;
return
w
;
}
}
static
void
update_thread_cleanup
(
void
*
p
)
{
vlc_thread_t
*
th
=
p
;
vlc_cancel
(
*
th
);
vlc_join
(
*
th
,
NULL
);
}
static
void
dummy_cleanup
(
void
*
p
)
{
(
void
)
p
;
}
static
void
*
vnc_worker_thread
(
void
*
obj
)
static
void
*
vnc_worker_thread
(
void
*
obj
)
{
{
filter_t
*
p_filter
=
(
filter_t
*
)
obj
;
filter_t
*
p_filter
=
(
filter_t
*
)
obj
;
filter_sys_t
*
p_sys
=
p_filter
->
p_sys
;
filter_sys_t
*
p_sys
=
p_filter
->
p_sys
;
vlc_thread_t
update_
request_thread_handle
;
vlc_thread_t
update_
thread
;
int
canc
=
vlc_savecancel
();
int
canc
=
vlc_savecancel
();
msg_Dbg
(
p_filter
,
"VNC worker thread started"
);
msg_Dbg
(
p_filter
,
"VNC worker thread started"
);
...
@@ -607,13 +620,16 @@ static void* vnc_worker_thread( void *obj )
...
@@ -607,13 +620,16 @@ static void* vnc_worker_thread( void *obj )
/* create the update request thread */
/* create the update request thread */
bool
polling
=
var_InheritBool
(
p_filter
,
RMTOSD_CFG
"vnc-polling"
);
bool
polling
=
var_InheritBool
(
p_filter
,
RMTOSD_CFG
"vnc-polling"
);
if
(
polling
if
(
polling
&&
vlc_clone
(
&
update_
request_thread_handle
,
update_request_thread
,
&&
vlc_clone
(
&
update_
thread
,
update_request_thread
,
p_filter
,
VLC_THREAD_PRIORITY_LOW
)
)
p_filter
,
VLC_THREAD_PRIORITY_LOW
)
)
{
{
msg_Err
(
p_filter
,
"cannot spawn VNC update request thread"
);
msg_Err
(
p_filter
,
"cannot spawn VNC update request thread"
);
polling
=
false
;
polling
=
false
;
}
}
vlc_cleanup_push
(
polling
?
update_thread_cleanup
:
dummy_cleanup
,
&
update_thread
);
/* connection is initialized, now read and handle server messages */
/* connection is initialized, now read and handle server messages */
for
(
;;
)
for
(
;;
)
{
{
...
@@ -668,11 +684,9 @@ static void* vnc_worker_thread( void *obj )
...
@@ -668,11 +684,9 @@ static void* vnc_worker_thread( void *obj )
process_server_message
(
p_filter
,
&
msg
);
process_server_message
(
p_filter
,
&
msg
);
}
}
vlc_cleanup_pop
();
if
(
polling
)
if
(
polling
)
{
update_thread_cleanup
(
&
update_thread
);
vlc_cancel
(
update_request_thread_handle
);
vlc_join
(
update_request_thread_handle
,
NULL
);
}
msg_Dbg
(
p_filter
,
"VNC message reader thread ended"
);
msg_Dbg
(
p_filter
,
"VNC message reader thread ended"
);
vlc_restorecancel
(
canc
);
vlc_restorecancel
(
canc
);
...
...
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