[ios, macos] Raise exception if MGLMapSnapshotter is used from thread without active run loop.
This commit is contained in:
@@ -108,6 +108,11 @@ const CGFloat MGLSnapshotterMinimumPixelSize = 64;
|
||||
|
||||
- (void)startWithQueue:(dispatch_queue_t)queue completionHandler:(MGLMapSnapshotCompletionHandler)completion
|
||||
{
|
||||
if (!mbgl::Scheduler::GetCurrent()) {
|
||||
[NSException raise:NSInvalidArgumentException
|
||||
format:@"startWithQueue:completionHandler: must be called from a thread with an active run loop."];
|
||||
}
|
||||
|
||||
if ([self isLoading]) {
|
||||
[NSException raise:NSInternalInconsistencyException
|
||||
format:@"Already started this snapshotter."];
|
||||
|
||||
Reference in New Issue
Block a user