mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-14 10:05:44 -04:00
Don't dispose window twice on OSX.
This commit is contained in:
parent
d71efc2b7c
commit
a8be2e4493
@ -110,7 +110,7 @@ namespace OpenTK.Platform.MacOS {
|
||||
API.CheckReturn(err);
|
||||
|
||||
API.SetWindowTitle(windowRef, title);
|
||||
window = new CarbonWindowInfo(windowRef, this, true);
|
||||
window = new CarbonWindowInfo(windowRef, this);
|
||||
SetLocation(r.X, r.Y);
|
||||
SetSize(r.Width, r.Height);
|
||||
|
||||
|
@ -34,16 +34,14 @@ namespace OpenTK.Platform.MacOS {
|
||||
sealed class CarbonWindowInfo : IWindowInfo {
|
||||
|
||||
public IntPtr WindowRef;
|
||||
bool ownHandle = false;
|
||||
bool disposed = false;
|
||||
internal bool goFullScreenHack = false;
|
||||
internal bool goWindowedHack = false;
|
||||
internal CarbonGLNative nativeWindow;
|
||||
|
||||
public CarbonWindowInfo( IntPtr windowRef, CarbonGLNative nativeWindow, bool ownHandle ) {
|
||||
public CarbonWindowInfo( IntPtr windowRef, CarbonGLNative nativeWindow ) {
|
||||
this.WindowRef = windowRef;
|
||||
this.nativeWindow = nativeWindow;
|
||||
this.ownHandle = ownHandle;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
@ -56,24 +54,6 @@ namespace OpenTK.Platform.MacOS {
|
||||
}
|
||||
|
||||
public void Dispose() {
|
||||
Dispose(true);
|
||||
}
|
||||
|
||||
void Dispose(bool disposing) {
|
||||
if (disposed)
|
||||
return;
|
||||
|
||||
if (ownHandle) {
|
||||
Debug.Print("Disposing window {0}.", WindowRef);
|
||||
Carbon.API.DisposeWindow(this.WindowRef);
|
||||
WindowRef = IntPtr.Zero;
|
||||
}
|
||||
|
||||
disposed = true;
|
||||
}
|
||||
|
||||
~CarbonWindowInfo() {
|
||||
Dispose(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user