| 1569 | } |
| 1570 | |
| 1571 | void SAMBridge::CloseSession (std::string_view id) |
| 1572 | { |
| 1573 | std::shared_ptr<SAMSession> session; |
| 1574 | { |
| 1575 | std::unique_lock<std::mutex> l(m_SessionsMutex); |
| 1576 | auto it = m_Sessions.find (id); |
| 1577 | if (it != m_Sessions.end ()) |
| 1578 | { |
| 1579 | session = it->second; |
| 1580 | m_Sessions.erase (it); |
| 1581 | } |
| 1582 | } |
| 1583 | if (session) |
| 1584 | { |
| 1585 | session->StopLocalDestination (); |
| 1586 | session->Close (); |
| 1587 | if (m_IsSingleThread) |
| 1588 | ScheduleSessionCleanupTimer (session); // let all session's streams close |
| 1589 | } |
| 1590 | } |
| 1591 | |
| 1592 | void SAMBridge::ScheduleSessionCleanupTimer (std::shared_ptr<SAMSession> session) |
| 1593 | { |
no test coverage detected