Browse Source

“Fix” for loop cancellation

pull/1977/head
Nikita Tsukanov 8 years ago
parent
commit
5054f2b9eb
  1. 4
      src/Avalonia.Native.OSX/platformthreading.mm

4
src/Avalonia.Native.OSX/platformthreading.mm

@ -106,9 +106,11 @@ public:
[[NSApplication sharedApplication] activateIgnoringOtherApps:true]; [[NSApplication sharedApplication] activateIgnoringOtherApps:true];
while(true) while(true)
{ {
if(can != NULL && can->Cancelled)
return;
NSEvent* ev = [[NSApplication sharedApplication] NSEvent* ev = [[NSApplication sharedApplication]
nextEventMatchingMask:NSEventMaskAny nextEventMatchingMask:NSEventMaskAny
untilDate: [NSDate distantFuture] untilDate: [NSDate dateWithTimeIntervalSinceNow:1]
inMode:NSDefaultRunLoopMode inMode:NSDefaultRunLoopMode
dequeue:true]; dequeue:true];
if(can != NULL && can->Cancelled) if(can != NULL && can->Cancelled)

Loading…
Cancel
Save