Austin Schuh | 75263e3 | 2022-02-22 18:05:32 -0800 | [diff] [blame] | 1 | // Copyright (c) FIRST and other WPILib contributors. |
| 2 | // Open Source Software; you can modify and/or share it under the terms of |
| 3 | // the WPILib BSD license file in the root directory of this project. |
| 4 | |
| 5 | #include "MulticastHandleManager.h" |
| 6 | |
| 7 | using namespace wpi; |
| 8 | |
| 9 | MulticastHandleManager& wpi::GetMulticastManager() { |
| 10 | static MulticastHandleManager manager; |
| 11 | return manager; |
| 12 | } |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame^] | 13 | |
| 14 | #ifdef _WIN32 |
| 15 | MulticastHandleManager::~MulticastHandleManager() { |
| 16 | // Multicast handles cannot be safely destructed on windows during shutdown. |
| 17 | // Just leak all handles. |
| 18 | for (auto&& i : resolvers) { |
| 19 | i.second.release(); |
| 20 | } |
| 21 | |
| 22 | for (auto&& i : announcers) { |
| 23 | i.second.release(); |
| 24 | } |
| 25 | } |
| 26 | #endif |