Fix thread-safety of qnetworkinterface_win.cpp:resolveLibs

Change-Id: Ia4b5103c9c590c24de9a43c5c7097b0c7b83e679
Reviewed-by: Richard J. Moore <rich@kde.org>
This commit is contained in:
Thiago Macieira 2015-08-11 19:39:43 -07:00
parent c72311440b
commit 4fbc63f03b

View File

@ -58,11 +58,11 @@ static void resolveLibs()
static bool done = false;
if (!done) {
done = true;
HINSTANCE iphlpapiHnd = QSystemLibrary::load(L"iphlpapi");
if (iphlpapiHnd == NULL)
if (iphlpapiHnd == NULL) {
done = true;
return;
}
#if defined(Q_OS_WINCE)
ptrGetAdaptersInfo = (PtrGetAdaptersInfo)GetProcAddress(iphlpapiHnd, L"GetAdaptersInfo");
@ -73,6 +73,7 @@ static void resolveLibs()
ptrGetAdaptersAddresses = (PtrGetAdaptersAddresses)GetProcAddress(iphlpapiHnd, "GetAdaptersAddresses");
ptrGetNetworkParams = (PtrGetNetworkParams)GetProcAddress(iphlpapiHnd, "GetNetworkParams");
#endif
done = true;
}
}