Skip to content

Commit

Permalink
Avoid switching GC mode in COM's HasValidTarget (#62066)
Browse files Browse the repository at this point in the history
* Avoid switching GC mode in COM's HasValidTarget

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
  • Loading branch information
am11 and jkotas committed Nov 26, 2021
1 parent c00b068 commit 15649df
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/coreclr/vm/interoplibinterface_comwrappers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1169,11 +1169,7 @@ namespace InteropLibImports
bool isValid = false;
::OBJECTHANDLE objectHandle = static_cast<::OBJECTHANDLE>(handle);

{
// Switch to cooperative mode so the handle can be safely inspected.
GCX_COOP_THREAD_EXISTS(GET_THREAD());
isValid = ObjectFromHandle(objectHandle) != NULL;
}
isValid = ObjectHandleIsNull(objectHandle) != FALSE;

return isValid;
}
Expand Down

0 comments on commit 15649df

Please sign in to comment.