mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-14 18:15:28 -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.CheckReturn(err);
|
||||||
|
|
||||||
API.SetWindowTitle(windowRef, title);
|
API.SetWindowTitle(windowRef, title);
|
||||||
window = new CarbonWindowInfo(windowRef, this, true);
|
window = new CarbonWindowInfo(windowRef, this);
|
||||||
SetLocation(r.X, r.Y);
|
SetLocation(r.X, r.Y);
|
||||||
SetSize(r.Width, r.Height);
|
SetSize(r.Width, r.Height);
|
||||||
|
|
||||||
|
@ -34,16 +34,14 @@ namespace OpenTK.Platform.MacOS {
|
|||||||
sealed class CarbonWindowInfo : IWindowInfo {
|
sealed class CarbonWindowInfo : IWindowInfo {
|
||||||
|
|
||||||
public IntPtr WindowRef;
|
public IntPtr WindowRef;
|
||||||
bool ownHandle = false;
|
|
||||||
bool disposed = false;
|
bool disposed = false;
|
||||||
internal bool goFullScreenHack = false;
|
internal bool goFullScreenHack = false;
|
||||||
internal bool goWindowedHack = false;
|
internal bool goWindowedHack = false;
|
||||||
internal CarbonGLNative nativeWindow;
|
internal CarbonGLNative nativeWindow;
|
||||||
|
|
||||||
public CarbonWindowInfo( IntPtr windowRef, CarbonGLNative nativeWindow, bool ownHandle ) {
|
public CarbonWindowInfo( IntPtr windowRef, CarbonGLNative nativeWindow ) {
|
||||||
this.WindowRef = windowRef;
|
this.WindowRef = windowRef;
|
||||||
this.nativeWindow = nativeWindow;
|
this.nativeWindow = nativeWindow;
|
||||||
this.ownHandle = ownHandle;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string ToString() {
|
public override string ToString() {
|
||||||
@ -56,24 +54,6 @@ namespace OpenTK.Platform.MacOS {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose() {
|
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