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

Audit Dispose pattern in the codebase and add it to the style guide for reference #93

Open
shana opened this issue Jul 5, 2017 · 4 comments

Comments

@shana
Copy link
Contributor

@shana shana commented Jul 5, 2017

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);
}
@AkashGutha
Copy link
Contributor

@AkashGutha AkashGutha commented Sep 13, 2017

I'll do this.

where is the style guide? I'm unable to find it.

@shana
Copy link
Contributor Author

@shana shana commented Mar 21, 2018

Oh wow I totally forgot about this, thanks @Frozenfire92

@MariaAp80
Copy link

@MariaAp80 MariaAp80 commented Sep 3, 2020

GitHub utilitário in developmente and Support for unity the blob máster.

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

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.