summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmkiley <jordan.kiley@mapbox.com>2018-11-06 12:35:43 -0800
committerjmkiley <jordan.kiley@mapbox.com>2018-11-06 12:35:43 -0800
commitbaed5ff390f8b17a2a85b3b1638f949f056efa85 (patch)
tree3582a30c3389c578647243d6362b09acd1a37ff5
parente35921e504a94cbe5f8cbc35b15943f1d2e8903f (diff)
downloadqtlocation-mapboxgl-baed5ff390f8b17a2a85b3b1638f949f056efa85.tar.gz
[ios] move creation of attributed string to global queue
-rw-r--r--platform/darwin/src/MGLAttributionInfo.mm12
1 files changed, 8 insertions, 4 deletions
diff --git a/platform/darwin/src/MGLAttributionInfo.mm b/platform/darwin/src/MGLAttributionInfo.mm
index 07d10e852b..cdea313f6e 100644
--- a/platform/darwin/src/MGLAttributionInfo.mm
+++ b/platform/darwin/src/MGLAttributionInfo.mm
@@ -65,10 +65,14 @@
NSData *htmlData = [styledHTML dataUsingEncoding:NSUTF8StringEncoding];
#if TARGET_OS_IPHONE
- NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithData:htmlData
- options:options
- documentAttributes:nil
- error:NULL];
+ __block NSMutableAttributedString *attributedString;
+
+ dispatch_sync(dispatch_get_main_queue() , ^{
+ attributedString = [[NSMutableAttributedString alloc] initWithData:htmlData
+ options:options
+ documentAttributes:nil
+ error:NULL];
+ });
#else
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithHTML:htmlData
options:options