When closing the connection, unref the currently used sockets. This should close
them when not in use. We need to do this because else we cannot reconnect
anymore after a close, the connect function requires that the sockets are NULL.
{
g_return_val_if_fail (conn != NULL, GST_RTSP_EINVAL);
+ /* last unref closes the connection we don't want to explicitly close here
+ * because these sockets might have been provided at construction */
+ if (conn->socket0) {
+ g_object_unref (conn->socket0);
+ conn->socket0 = NULL;
+ }
+ if (conn->socket1) {
+ g_object_unref (conn->socket1);
+ conn->socket1 = NULL;
+ }
+
g_free (conn->ip);
conn->ip = NULL;
g_return_val_if_fail (conn != NULL, GST_RTSP_EINVAL);
res = gst_rtsp_connection_close (conn);
- if (conn->socket0)
- g_object_unref (conn->socket0);
- if (conn->socket1)
- g_object_unref (conn->socket1);
if (conn->cancellable)
g_object_unref (conn->cancellable);