--- /home/silentm/Development/gst-rtsp-server/gst/rtsp-server/rtsp-client.c	2011-07-28 11:43:20.169072997 -0400
+++ /home/silentm/Development/gst-rtsp-server-patched/gst/rtsp-server/rtsp-client.c	2011-07-28 11:40:21.996949368 -0400
@@ -121,6 +121,9 @@
 
   /* unlink all media managed in this session */
   for (medias = session->medias; medias; medias = g_list_next (medias)) {
+    gst_rtsp_session_media_set_state ((GstRTSPSessionMedia *) medias->data, GST_STATE_NULL);
+    /* unmanage the media in the session. */
+    gst_rtsp_session_release_media (session, (GstRTSPSessionMedia *) medias->data);
     unlink_session_streams (client, session,
         (GstRTSPSessionMedia *) medias->data);
   }
