| 797 | } |
| 798 | |
| 799 | void PortsCleanup::closePorts() |
| 800 | { |
| 801 | if (m_ports) |
| 802 | delay(); |
| 803 | |
| 804 | MutexLockGuard guard(m_mutex, FB_FUNCTION); |
| 805 | AutoSetRestore cl(&closing, true); |
| 806 | |
| 807 | { // scope |
| 808 | MutexUnlockGuard g2(m_mutex, FB_FUNCTION); |
| 809 | Thread::yield(); |
| 810 | } |
| 811 | |
| 812 | if (m_ports) |
| 813 | { |
| 814 | rem_port* const* ptr = m_ports->begin(); |
| 815 | const rem_port* const* end = m_ports->end(); |
| 816 | for (; ptr < end; ptr++) { |
| 817 | closePort(*ptr); |
| 818 | } |
| 819 | |
| 820 | delete m_ports; |
| 821 | m_ports = NULL; |
| 822 | } |
| 823 | } |
| 824 | |
| 825 | void PortsCleanup::closePort(rem_port* port) |
| 826 | { |
no test coverage detected