mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-23 15:35:34 +00:00
Changed IsDisposed into a property and modified code to use this instead of the backing field.
This commit is contained in:
parent
f020cfce33
commit
26db415bd8
|
@ -244,7 +244,7 @@ namespace OpenTK
|
|||
{
|
||||
get
|
||||
{
|
||||
return disposed ? false : implementation.Exists; // TODO: Should disposed be ignored instead?
|
||||
return IsDisposed ? false : implementation.Exists; // TODO: Should disposed be ignored instead?
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -577,7 +577,7 @@ namespace OpenTK
|
|||
/// </summary>
|
||||
public virtual void Dispose()
|
||||
{
|
||||
if (!disposed)
|
||||
if (!IsDisposed)
|
||||
{
|
||||
if ((options & GameWindowFlags.Fullscreen) != 0)
|
||||
{
|
||||
|
@ -587,7 +587,7 @@ namespace OpenTK
|
|||
implementation.Dispose();
|
||||
GC.SuppressFinalize(this);
|
||||
|
||||
disposed = true;
|
||||
IsDisposed = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -609,16 +609,21 @@ namespace OpenTK
|
|||
/// </exception>
|
||||
protected void EnsureUndisposed()
|
||||
{
|
||||
if (disposed) throw new ObjectDisposedException(GetType().Name);
|
||||
if (IsDisposed) throw new ObjectDisposedException(GetType().Name);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IsDisposed
|
||||
|
||||
protected bool IsDisposed() //TODO: Could be a property but with a different name than the variable because of the event. Alternatively the disposed variable could be renamed too.
|
||||
/// <summary>
|
||||
/// Gets or sets a <see cref="System.Boolean"/>, which indicates whether
|
||||
/// this instance has been disposed.
|
||||
/// </summary>
|
||||
protected bool IsDisposed
|
||||
{
|
||||
return disposed;
|
||||
get { return disposed; }
|
||||
set { disposed = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
Loading…
Reference in a new issue