Change ConditionalWeakTable.Clear
authorStephen Toub <stoub@microsoft.com>
Sat, 10 Dec 2016 00:00:50 +0000 (19:00 -0500)
committerStephen Toub <stoub@microsoft.com>
Sat, 10 Dec 2016 00:00:50 +0000 (19:00 -0500)
commitf084f1c71cf15a8dc918630bd95912f9bd720098
tree2a9ef91de035d379345dddf5668dbc6cb18399c1
parentff34a07ec32dd125f093be07c7f0a02778a3c86c
Change ConditionalWeakTable.Clear

The original CoreRT implementation just dropped the current table and replaced it with a new one.  In the process of porting the CoreRT implementation to CoreCLR, I'd changed it to instead remove each item from the table (by setting its hashcode to -1, as does Remove), in order to work around some code in the finalizer that would null out te parent's reference to the container, and that would cause problems with dropping this table... but that code in the finalizer changed before it got merged, and in its current form, the old CoreRT clear implementation was fine.  It's also likely better, as it'll let the handles be cleaned up earlier, and it's simple.  So reverting back to it.
src/mscorlib/src/System/Runtime/CompilerServices/ConditionalWeakTable.cs