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