private IntPtr _configHandle = IntPtr.Zero;
private bool _disposed = false;
private WiFiEapConfiguration _eapConfig;
+ private readonly Object _lock = new Object();
/// <summary>
/// The name of the access point (AP).
private void Dispose(bool disposing)
{
- if (_disposed)
- return;
+ lock (_lock)
+ {
+ if (_disposed)
+ return;
+
+ if (disposing)
+ {
+ Interop.WiFi.Config.Destroy(_configHandle);
+ _configHandle = IntPtr.Zero;
+ }
- Interop.WiFi.Config.Destroy(_configHandle);
- _configHandle = IntPtr.Zero;
- _disposed = true;
+ _disposed = true;
+ }
}
internal IntPtr GetHandle()