Add GC.KeepAlive to COM paths in WeakReference (#88537)
authorMark Plesko <markples@microsoft.com>
Wed, 12 Jul 2023 16:32:23 +0000 (09:32 -0700)
committerGitHub <noreply@github.com>
Wed, 12 Jul 2023 16:32:23 +0000 (09:32 -0700)
commita3c21b95c91012df3e2572a1331ed7cc1f2679e6
tree280f6191387215130e13d36083425f687bd335a6
parent82bf906968d9bc1ca5b3131c7a7af8f30d5ac2f5
Add GC.KeepAlive to COM paths in WeakReference (#88537)

Omission was noticed by @AustinWise. I reproed the failure and this fix for it on linux-x64.

Fixes #81362
src/libraries/System.Private.CoreLib/src/System/WeakReference.T.cs
src/libraries/System.Private.CoreLib/src/System/WeakReference.cs
src/tests/Interop/COM/ComWrappers/WeakReference/WeakReferenceTest.csproj