d3dvideosink: Don't leak GThread object

Need to call g_thread_join() to avoid leak
This commit is contained in:
Seungha Yang 2018-11-03 20:20:50 +09:00 committed by Sebastian Dröge
parent c9b204ea87
commit b3279c3fce
2 changed files with 9 additions and 0 deletions

View file

@ -1208,6 +1208,12 @@ d3d_stop (GstD3DVideoSink * sink)
/* Release D3D resources */ /* Release D3D resources */
d3d_set_window_handle (sink, 0, FALSE); d3d_set_window_handle (sink, 0, FALSE);
if (sink->internal_window_thread) {
g_thread_join (sink->internal_window_thread);
sink->internal_window_thread = NULL;
}
return TRUE; return TRUE;
} }
@ -2262,6 +2268,8 @@ d3d_create_internal_window (GstD3DVideoSink * sink)
return 0; return 0;
} }
sink->internal_window_thread = thread;
/* Wait 10 seconds for window proc loop to start up */ /* Wait 10 seconds for window proc loop to start up */
for (i = 0; dat.running == FALSE && i < intervals; i++) { for (i = 0; dat.running == FALSE && i < intervals; i++) {
g_usleep (timeout_interval); g_usleep (timeout_interval);

View file

@ -60,6 +60,7 @@ struct _GstD3DVideoSink
GstVideoRectangle render_rect; GstVideoRectangle render_rect;
GRecMutex lock; GRecMutex lock;
GThread *internal_window_thread;
/* Properties */ /* Properties */
gboolean force_aspect_ratio; gboolean force_aspect_ratio;