Last active
June 30, 2021 16:08
-
-
Save chrisnas/b466ef20374ee4f0e12afbe8de73e747 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
private void Cleanup(bool fromGC) | |
{ | |
if (_disposed) | |
return; | |
try | |
{ | |
// always clean up the NATIVE resources | |
if (fromGC) | |
return; | |
// clean up managed resources ONLY if not called from GC | |
} | |
finally | |
{ | |
_disposed = true; | |
if (!fromGC) | |
GC.SuppressFinalize(this); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment