diff options
author | Justin R. Miller <incanus@codesorcery.net> | 2014-02-03 19:23:51 -0500 |
---|---|---|
committer | Justin R. Miller <incanus@codesorcery.net> | 2014-02-03 19:23:51 -0500 |
commit | cd5b88edba6b1a27b8ae1064fc4b95ec291f8f98 (patch) | |
tree | d882cc1b15197b709c35860ba49cfd16c1c6d4a1 /macosx | |
parent | a5bdf294bb4045a9a637030383c5077d51ecb895 (diff) | |
download | qtlocation-mapboxgl-cd5b88edba6b1a27b8ae1064fc4b95ec291f8f98.tar.gz |
no need for GCD tossing since completion happens on (explicit) main queue
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/main.mm | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/macosx/main.mm b/macosx/main.mm index f1b02dabfe..1c12b7f3cf 100644 --- a/macosx/main.mm +++ b/macosx/main.mm @@ -233,17 +233,13 @@ void request_http(std::string url, std::function<void(Response&)> func) { completionHandler: ^ (NSURLResponse* response, NSData* data, NSError* error) { if (error == nil) { NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response; - dispatch_async(dispatch_get_main_queue(), ^ { - Response res; - res.code = [httpResponse statusCode]; - res.body = { (const char *)[data bytes], [data length] }; - func(res); - }); + Response res; + res.code = [httpResponse statusCode]; + res.body = { (const char *)[data bytes], [data length] }; + func(res); } else { - dispatch_async(dispatch_get_main_queue(), ^ { - Response res; - func(res); - }); + Response res; + func(res); } }]; } @@ -266,9 +262,7 @@ void request_http(std::string url, std::function<void(Response&)> func, std::fun } func(res); - dispatch_async(dispatch_get_main_queue(), ^ { - cb(); - }); + cb(); }]; } |