1
0
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:
Thomas Harte 2019-03-02 21:27:34 -05:00
parent 5b56ad0d78
commit 2beeaa513b
2 changed files with 16 additions and 14 deletions

View File

@ -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"

View File

@ -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)
}
} }
} }