macOS: Do not use dispatch queue when canceling idle callback (flutter/engine#27732)
Fixes https://github.com/flutter/flutter/issues/86932 Relying on dispatch queue to bump call on main thread in this instance is problematic because platform plugin can hold the dispatch queue. Using performSelectorOnMainThread: instead works, because it is processed by the CFRunLoop independent of dispatch queue.
This commit is contained in:
@@ -92,9 +92,11 @@ static const double kIdleDelay = 1.0;
|
||||
size:_surfaceSize];
|
||||
}
|
||||
};
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(onIdle) object:nil];
|
||||
});
|
||||
[self performSelectorOnMainThread:@selector(cancelIdle) withObject:nil waitUntilDone:NO];
|
||||
}
|
||||
|
||||
- (void)cancelIdle {
|
||||
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(onIdle) object:nil];
|
||||
}
|
||||
|
||||
- (nonnull FlutterRenderBackingStore*)renderBuffer {
|
||||
|
||||
Reference in New Issue
Block a user