Skip to content

Chapter 17 - Scene.Dispose() does not set the IsDisposed property to true at the end of the function #201

@jordanlhunt

Description

@jordanlhunt

I followed the tutorial and I notice that the Scene.Dispose() function does not set the IsDisposed property to true like it does in the AudioController.Dispose(). My proposed change is to add " IsDisposed = true;" at the end of the function.

/// <summary>
/// Disposes of this scene.
/// </summary>
/// <param name="disposing">'
/// Indicates whether managed resources should be disposed.  This value is only true when called from the main
/// Dispose method.  When called from the finalizer, this will be false.
/// </param>
protected virtual void Dispose(bool disposing)
{
    if (IsDisposed)
    {
        return;
    }
    if (disposing)
    {
        UnloadContent();
        Content.Dispose();
    }
    IsDisposed = true;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions