g_signal_emit (client, gst_rtsp_client_signals[SIGNAL_TEARDOWN_REQUEST],
0, ctx);
+ /* make sure we unblock the backlog and don't accept new messages
+ * on the watch */
+ gst_rtsp_watch_set_flushing (priv->watch, TRUE);
+
/* unlink the all TCP callbacks */
unlink_session_transports (client, session, sessmedia);
gst_rtsp_session_media_set_state (sessmedia, GST_STATE_NULL);
+ /* allow messages again so that we can send the reply */
+ gst_rtsp_watch_set_flushing (priv->watch, FALSE);
+
/* unmanage the media in the session, returns false if all media session
* are torn down. */
if (!gst_rtsp_session_release_media (session, sessmedia)) {