Created
January 12, 2019 18:54
-
-
Save chrisnas/8d2528ae525f46a2281e93d2d54a295a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PhantomObjectFinalizer : PhantomReference<LargeObject> | |
{ | |
private int _handle; | |
public PhantomObjectFinalizer(ReferenceQueue<LargeObject> queue, LargeObject value) | |
: base(queue, value) | |
{ | |
_handle = value.Handle; | |
} | |
public void FinalizeResources() | |
{ | |
Console.WriteLine("I'm cleaning handle " + _handle); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment