diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2011-10-07 12:45:40 (GMT) |
---|---|---|
committer | Jan-Arve Saether <jan-arve.saether@nokia.com> | 2011-10-07 12:45:40 (GMT) |
commit | a0feeef52efde872c6d6e458c8e15616da0bf74f (patch) | |
tree | 8c846d041bbce0ac4f10eac1b1b93250144f7f60 /src/network | |
parent | 74251fb0fc57b1e0f7db0b561e4aa4c0347f6f37 (diff) | |
download | Qt-a0feeef52efde872c6d6e458c8e15616da0bf74f.zip Qt-a0feeef52efde872c6d6e458c8e15616da0bf74f.tar.gz Qt-a0feeef52efde872c6d6e458c8e15616da0bf74f.tar.bz2 |
fix possible race conditions
the initialization guard must be set after the initialization is done;
for the code assumed to be only executed in a single thread, this change was done
just for consistency - in order to avoid similar issues by copy-pasting in future
Merge-request: 2655
Reviewed-by: Jan-Arve Saether <jan-arve.saether@nokia.com>
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/kernel/qnetworkinterface_win.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/network/kernel/qnetworkinterface_win.cpp b/src/network/kernel/qnetworkinterface_win.cpp index 5f273d7..a624468 100644 --- a/src/network/kernel/qnetworkinterface_win.cpp +++ b/src/network/kernel/qnetworkinterface_win.cpp @@ -63,16 +63,14 @@ static void resolveLibs() { // try to find the functions we need from Iphlpapi.dll static bool done = false; - if (!done) { - done = true; - QSystemLibrary iphlpapi(QLatin1String("iphlpapi")); if (iphlpapi.load()) { ptrGetAdaptersInfo = (PtrGetAdaptersInfo)iphlpapi.resolve("GetAdaptersInfo"); ptrGetAdaptersAddresses = (PtrGetAdaptersAddresses)iphlpapi.resolve("GetAdaptersAddresses"); ptrGetNetworkParams = (PtrGetNetworkParams)iphlpapi.resolve("GetNetworkParams"); } + done = true; } } |