Skip to content

Commit eb6588c

Browse files
author
Lifeng Lu
committed
Reuse existing WeakReference.
1 parent e5bfd8f commit eb6588c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Microsoft.VisualStudio.Threading/JoinableTask.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ internal int GetPendingEventCountForSynchronousTask(JoinableTask synchronousTask
10141014

10151015
if (this.pendingEventSource is null || taskHasPendingMessages == this)
10161016
{
1017-
this.pendingEventSource = new WeakReference<JoinableTask>(taskHasPendingMessages);
1017+
this.pendingEventSource = taskHasPendingMessages.WeakSelf;
10181018
}
10191019

10201020
this.pendingEventCount += newPendingMessagesCount;

0 commit comments

Comments
 (0)