News for hackers. Stuff that matters.
Re:Allocation is cheap in .NET until it is not by johncolanduoni on Wednesday January 24, 2018 @06:17PM (#16227260)
> (I believe once the GCHandle is freed/finalized by the GC, it will automatically unpin the object.)

GCHandle is a struct so you have to explicitly call GCHandle.Free().

Re:Allocation is cheap in .NET until it is not by kevingadd on Wednesday January 24, 2018 @06:26PM (#16227306)
Makes sense. I make a point of calling Free but it wasn't clear to me whether the pin was attached to the object reference (since the handle contains a reference).