mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-19 23:29:05 +00:00
Ensures a machine exists before messaging it.
This commit is contained in:
parent
5b56ad0d78
commit
2beeaa513b
@ -68,7 +68,7 @@
|
|||||||
</AdditionalOptions>
|
</AdditionalOptions>
|
||||||
</TestAction>
|
</TestAction>
|
||||||
<LaunchAction
|
<LaunchAction
|
||||||
buildConfiguration = "Release"
|
buildConfiguration = "Debug"
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
enableASanStackUseAfterReturn = "YES"
|
enableASanStackUseAfterReturn = "YES"
|
||||||
|
@ -199,6 +199,7 @@ class MachineDocument:
|
|||||||
|
|
||||||
// MARK: CSOpenGLViewDelegate
|
// MARK: CSOpenGLViewDelegate
|
||||||
final func openGLViewRedraw(_ view: CSOpenGLView, event redrawEvent: CSOpenGLViewRedrawEvent) {
|
final func openGLViewRedraw(_ view: CSOpenGLView, event redrawEvent: CSOpenGLViewRedrawEvent) {
|
||||||
|
if let machine = self.machine {
|
||||||
switch redrawEvent {
|
switch redrawEvent {
|
||||||
case .timer:
|
case .timer:
|
||||||
bestEffortLock.lock()
|
bestEffortLock.lock()
|
||||||
@ -208,11 +209,12 @@ class MachineDocument:
|
|||||||
} else {
|
} else {
|
||||||
bestEffortLock.unlock()
|
bestEffortLock.unlock()
|
||||||
}
|
}
|
||||||
self.machine.updateView(forPixelSize: view.backingSize)
|
machine.updateView(forPixelSize: view.backingSize)
|
||||||
fallthrough
|
fallthrough
|
||||||
|
|
||||||
case .appKit:
|
case .appKit:
|
||||||
self.machine.drawView(forPixelSize: view.backingSize)
|
machine.drawView(forPixelSize: view.backingSize)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user