X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gst-libs%2Fgst%2Frtsp%2Fgstrtspconnection.c;h=fa7ec81642ef05744138ce8d0bec8e89ff4abe2c;hb=0b0dde7ce11e15bedaf34aea2df843a5253d1e2f;hp=da9f51001ecf996e22a6fabe38f1c4c1a2a88fe5;hpb=2cd15bbef8ae52be6bb0e84dcdad573f78ee847e;p=platform%2Fupstream%2Fgstreamer.git diff --git a/gst-libs/gst/rtsp/gstrtspconnection.c b/gst-libs/gst/rtsp/gstrtspconnection.c index da9f510..fa7ec81 100644 --- a/gst-libs/gst/rtsp/gstrtspconnection.c +++ b/gst-libs/gst/rtsp/gstrtspconnection.c @@ -322,10 +322,12 @@ gst_rtsp_connection_accept (GSocket * socket, GstRTSPConnection ** conn, ip = g_inet_address_to_string (g_inet_socket_address_get_address (G_INET_SOCKET_ADDRESS (addr))); port = g_inet_socket_address_get_port (G_INET_SOCKET_ADDRESS (addr)); + g_object_unref (addr); ret = gst_rtsp_connection_create_from_socket (client_sock, ip, port, NULL, conn); + g_object_unref (client_sock); g_free (ip); return ret; @@ -2156,6 +2158,17 @@ gst_rtsp_connection_close (GstRTSPConnection * conn) { 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; @@ -2198,10 +2211,6 @@ gst_rtsp_connection_free (GstRTSPConnection * conn) 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);