From 95da2bcbcfcd567a0a7e1041f1ea9c9346fcecfd Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 19 Nov 2020 14:12:24 -0800 Subject: [PATCH] move CoUninitialize to the proper place at the end of the tap thread --- osdep/WindowsEthernetTap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osdep/WindowsEthernetTap.cpp b/osdep/WindowsEthernetTap.cpp index 3048626a5..71c7c503d 100644 --- a/osdep/WindowsEthernetTap.cpp +++ b/osdep/WindowsEthernetTap.cpp @@ -648,7 +648,6 @@ WindowsEthernetTap::WindowsEthernetTap( WindowsEthernetTap::~WindowsEthernetTap() { WinDNSHelper::removeDNS(_nwid); - CoUninitialize(); _run = false; ReleaseSemaphore(_injectSemaphore,1,NULL); Thread::join(_thread); @@ -1171,6 +1170,7 @@ void WindowsEthernetTap::threadMain() // We will restart and re-open the tap unless _run == false } } catch ( ... ) {} // catch unexpected exceptions -- this should not happen but would prevent program crash or other weird issues since threads should not throw + CoUninitialize(); } NET_IFINDEX WindowsEthernetTap::_getDeviceIndex()