mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 09:40:37 +00:00
souphttpclientsink: Fix error leak and handle error
g_thread_try_new allows for possiblity of failures. In case it fails, error is not handled and leaked. https://bugzilla.gnome.org/show_bug.cgi?id=758260
This commit is contained in:
parent
84b6743cf8
commit
bd701b8ee5
1 changed files with 8 additions and 1 deletions
|
@ -562,10 +562,17 @@ gst_soup_http_client_sink_start (GstBaseSink * sink)
|
||||||
|
|
||||||
g_mutex_lock (&souphttpsink->mutex);
|
g_mutex_lock (&souphttpsink->mutex);
|
||||||
|
|
||||||
/* FIXME: error handling */
|
|
||||||
souphttpsink->thread = g_thread_try_new ("souphttpclientsink-thread",
|
souphttpsink->thread = g_thread_try_new ("souphttpclientsink-thread",
|
||||||
thread_func, souphttpsink, &error);
|
thread_func, souphttpsink, &error);
|
||||||
|
|
||||||
|
if (error != NULL) {
|
||||||
|
GST_DEBUG_OBJECT (souphttpsink, "failed to start thread, %s",
|
||||||
|
error->message);
|
||||||
|
g_error_free (error);
|
||||||
|
g_mutex_unlock (&souphttpsink->mutex);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
GST_LOG_OBJECT (souphttpsink, "waiting for main loop thread to start up");
|
GST_LOG_OBJECT (souphttpsink, "waiting for main loop thread to start up");
|
||||||
g_cond_wait (&souphttpsink->cond, &souphttpsink->mutex);
|
g_cond_wait (&souphttpsink->cond, &souphttpsink->mutex);
|
||||||
g_mutex_unlock (&souphttpsink->mutex);
|
g_mutex_unlock (&souphttpsink->mutex);
|
||||||
|
|
Loading…
Reference in a new issue