# Destroy plugin handle for outgoing sessions. For incoming ones it's the same as the account handle, so don't
block_on(self.protocol.backend.janus_detach(self.janus_session_id,session.janus_handle_id))# todo: do we care to wait for this or not? (we ignore the detached event anyway)
# should only be called for publisher sessions and only from a green thread.
ifself.janus_session_idisNone:# The connection was closed, there is noting to do
return
ifsessioninself.videoroom_sessions:
self.videoroom_sessions.remove(session)
session.room.remove(session)
session.feeds.clear()
block_on(self.protocol.backend.janus_detach(self.janus_session_id,session.janus_handle_id))# todo: do we care to wait for this or not? (we ignore the detached event anyway)