From 5054f2b9ebdb979d1a6a23b5d0572fded50b3250 Mon Sep 17 00:00:00 2001 From: Nikita Tsukanov Date: Fri, 12 Oct 2018 17:05:55 +0300 Subject: [PATCH] =?UTF-8?q?=E2=80=9CFix=E2=80=9D=20for=20loop=20cancellati?= =?UTF-8?q?on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Avalonia.Native.OSX/platformthreading.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Avalonia.Native.OSX/platformthreading.mm b/src/Avalonia.Native.OSX/platformthreading.mm index cfc37a7436..5cd64155a3 100644 --- a/src/Avalonia.Native.OSX/platformthreading.mm +++ b/src/Avalonia.Native.OSX/platformthreading.mm @@ -106,9 +106,11 @@ public: [[NSApplication sharedApplication] activateIgnoringOtherApps:true]; while(true) { + if(can != NULL && can->Cancelled) + return; NSEvent* ev = [[NSApplication sharedApplication] nextEventMatchingMask:NSEventMaskAny - untilDate: [NSDate distantFuture] + untilDate: [NSDate dateWithTimeIntervalSinceNow:1] inMode:NSDefaultRunLoopMode dequeue:true]; if(can != NULL && can->Cancelled)