Close() method now calls implementation.Close() instead of Dispose() directly.

This commit is contained in:
the_fiddler 2009-08-20 22:26:57 +00:00
parent 3095504dd1
commit 9975aab0f9

View file

@ -143,11 +143,12 @@ namespace OpenTK
#region Close #region Close
/// <summary> /// <summary>
/// Closes the NativeWindow. Equivalent to calling <see cref="OpenTK.NativeWindow.Dispose()"/>. /// Closes the NativeWindow.
/// </summary> /// </summary>
public void Close() public void Close()
{ {
Dispose(); EnsureUndisposed();
implementation.Close();
} }
#endregion #endregion
@ -617,9 +618,13 @@ namespace OpenTK
/// </summary> /// </summary>
public void Dispose() public void Dispose()
{ {
implementation.Dispose(); if (!disposed)
disposed = true; {
GC.SuppressFinalize(this); implementation.Dispose();
GC.SuppressFinalize(this);
disposed = true;
}
} }
#endregion #endregion
@ -787,7 +792,7 @@ namespace OpenTK
if (Closing != null) Closing(this, e); if (Closing != null) Closing(this, e);
if (!e.Cancel) Close(); //if (!e.Cancel) Close();
} }
#endregion #endregion
@ -878,7 +883,7 @@ namespace OpenTK
{ {
OnWindowBorderChanged(e); OnWindowBorderChanged(e);
if (WindowBorderChanged != null) WindowBorderChanged(this, e); // TODO: This was raised with EventArgs.Empty. Special reason? if (WindowBorderChanged != null) WindowBorderChanged(this, e); // TODO: This was closed with EventArgs.Empty. Special reason?
} }
#endregion #endregion