Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 7d1c6f0

Browse files
Creating the TaskManager instance on usage of the property
1 parent 849e2b4 commit 7d1c6f0

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/GitHub.Api/Tasks/TaskManager.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,19 @@ public class TaskManager : ITaskManager
1717
public CancellationToken Token { get { return cts.Token; } }
1818

1919
private static ITaskManager instance;
20-
public static ITaskManager Instance => instance;
20+
public static ITaskManager Instance
21+
{
22+
get
23+
{
24+
if (instance == null)
25+
{
26+
instance = new TaskManager();
27+
}
28+
29+
return instance;
30+
}
31+
}
32+
2133
private ProgressReporter progressReporter = new ProgressReporter();
2234

2335
public event Action<IProgress> OnProgress

0 commit comments

Comments
 (0)