diff options
author | jmkiley <jordan.kiley@mapbox.com> | 2018-11-06 12:35:43 -0800 |
---|---|---|
committer | jmkiley <jordan.kiley@mapbox.com> | 2018-11-06 12:35:43 -0800 |
commit | baed5ff390f8b17a2a85b3b1638f949f056efa85 (patch) | |
tree | 3582a30c3389c578647243d6362b09acd1a37ff5 | |
parent | e35921e504a94cbe5f8cbc35b15943f1d2e8903f (diff) | |
download | qtlocation-mapboxgl-baed5ff390f8b17a2a85b3b1638f949f056efa85.tar.gz |
[ios] move creation of attributed string to global queue
-rw-r--r-- | platform/darwin/src/MGLAttributionInfo.mm | 12 |
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 |