We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b59741c commit 521082fCopy full SHA for 521082f
CommunityToolkit.WinUI/Extensions/DispatcherQueueExtensions{T}.cs
@@ -134,6 +134,11 @@ private static unsafe bool TryEnqueue<THandler>(DispatcherQueue dispatcherQueue,
134
}
135
finally
136
{
137
+ // This call doesn not have a corresponding AddRef() invocation that is visible, and
138
+ // that is because the static constructors for all existing custom handlers already
139
+ // set the internal reference count to 1. Structuring the code like this makes it
140
+ // possible to centralize all logic in this method without each caller needing to
141
+ // explicitly have a try/finally block for the allocated handler that is passed here.
142
dispatcherQueueHandler->Release();
143
144
0 commit comments