Skip to content

Commit 621cb4c

Browse files
authored
Merge branch 'master' into normalize-tilecontrol
2 parents afa684d + 1ebc426 commit 621cb4c

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

Microsoft.Toolkit.Uwp.Input.GazeInteraction/GazePointer.cs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Collections.Generic;
77
using System.Diagnostics;
88
using System.Linq;
9+
using System.Threading;
910
using System.Threading.Tasks;
1011
using Windows.Devices.Input.Preview;
1112
using Windows.Foundation;
@@ -298,20 +299,9 @@ internal int CursorRadius
298299
/// </summary>
299300
public bool IsAlwaysActivated { get; set; }
300301

301-
private static GazePointer _instance = null;
302+
private static ThreadLocal<GazePointer> _instance = new ThreadLocal<GazePointer>(() => new GazePointer());
302303

303-
internal static GazePointer Instance
304-
{
305-
get
306-
{
307-
if (_instance == null)
308-
{
309-
_instance = new GazePointer();
310-
}
311-
312-
return _instance;
313-
}
314-
}
304+
internal static GazePointer Instance => _instance.Value;
315305

316306
internal void AddRoot(int proxyId)
317307
{

0 commit comments

Comments
 (0)