Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GLResource.cs has unnecessary GC.KeepAlive(this) call. #2

Open
john-h-k opened this issue Mar 16, 2019 · 3 comments
Open

GLResource.cs has unnecessary GC.KeepAlive(this) call. #2

john-h-k opened this issue Mar 16, 2019 · 3 comments

Comments

@john-h-k
Copy link

this cannot be disposed during execution of one of its methods. Dispose is an instance member. Call is unnecessary and will just slightly hurt perf

@JcBernack
Copy link
Collaborator

These articles say something different:

An object can become eligible for collection during execution of a method on that very object.

@john-h-k
Copy link
Author

Yes, it is useful in a finalizer. But this is in Dispose, where it is useless

@john-h-k
Copy link
Author

Put it in the actual finalizer, not the top level Dispose method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants