1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-01-16 11:30:22 +00:00

Resolves crash upon File -> New..., Cancel; also ensures slow performance can't equal no progression.

This commit is contained in:
Thomas Harte 2020-02-14 23:16:44 -05:00
parent 763159a6f6
commit e1892ff370
2 changed files with 2 additions and 6 deletions

View File

@ -84,7 +84,7 @@ class MachineDocument:
} }
override func close() { override func close() {
machine.stop() machine?.stop()
activityPanel?.setIsVisible(false) activityPanel?.setIsVisible(false)
activityPanel = nil activityPanel = nil

View File

@ -770,11 +770,7 @@ struct ActivityObserver: public Activity::Observer {
// Grab the time now and, therefore, the amount of time since the timer last fired // Grab the time now and, therefore, the amount of time since the timer last fired
// (capped at half a second). // (capped at half a second).
const auto timeNow = Time::nanos_now(); const auto timeNow = Time::nanos_now();
const auto duration = timeNow - lastTime; const auto duration = std::min(timeNow - lastTime, Time::Nanos(10'000'000'000 / TICKS));
if(duration > Time::Nanos(500'000'000)) {
lastTime = timeNow;
return;
}
CGSize pixelSize; CGSize pixelSize;
BOOL splitAndSync = NO; BOOL splitAndSync = NO;