Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[ios, macos] Raise exception if MGLMapSnapshotter is used from thread…
Browse files Browse the repository at this point in the history
… without active run loop.
  • Loading branch information
Julian Rex authored and ChrisLoer committed May 29, 2018
1 parent 59ef266 commit 98727ca
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions platform/darwin/src/MGLMapSnapshotter.mm
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ - (void)startWithCompletionHandler:(MGLMapSnapshotCompletionHandler)completion

- (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."];
Expand Down

0 comments on commit 98727ca

Please sign in to comment.