[release/6.0-rc2] Check if External Object Context is still active after a possible...
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Fri, 24 Sep 2021 17:23:55 +0000 (10:23 -0700)
committerGitHub <noreply@github.com>
Fri, 24 Sep 2021 17:23:55 +0000 (10:23 -0700)
commit53d2560e67d4be085f5bc22a86debcaed51de2a0
tree3df3204dbf5447058a4cd74df50f29c898cf8b00
parent212c440c23beab55922f4893621c5b9e858dc26a
[release/6.0-rc2] Check if External Object Context is still active after a possible GC (#59436)

* Check if External Object Context is still active after a possible GC

* Update interoplibinterface_comwrappers.cpp

Check if `IsActive()` during consideration too.

* Issues can occur during the multiple managed allocations.

* Add validation of non-null elements in ReleaseObjects() API call. Use detach state instead of IsActive state for EOC.

* Apply suggestions from code review

Co-authored-by: Elinor Fung <elfung@microsoft.com>
* Apply suggestions from code review

Co-authored-by: Elinor Fung <elfung@microsoft.com>
* Review feedback

Co-authored-by: Aaron Robinson <arobins@microsoft.com>
Co-authored-by: Elinor Fung <elfung@microsoft.com>
src/coreclr/vm/interoplibinterface_comwrappers.cpp
src/tests/Interop/COM/ComWrappers/GlobalInstance/GlobalInstance.cs