Unity
Unity copied to clipboard
Audit Dispose pattern in the codebase and add it to the style guide for reference
We should add the Dispose pattern to the style guide so we don't have to go hunting for it whenever we need it. We should also audit the existing code to make sure it follows the correct pattern where it needs to.
private bool disposed;
public virtual void Dispose(bool disposing)
{
if (disposed) return;
disposed = true;
if (disposing) {
// dispose managed stuff
}
// dispose native stuff that we hold an exclusive reference to (nobody else is going to kill them off via GC or finalizer). Do not access any data via managed references here.
}
public void Dispose()
{
Dispose(true);
}
I'll do this.
where is the style guide? I'm unable to find it.
@AkashGutha https://github.com/github-for-unity/Unity/blob/master/docs/contributing/styleguide.md
Oh wow I totally forgot about this, thanks @Frozenfire92
GitHub utilitário in developmente and Support for unity the blob máster.