From cd5b88edba6b1a27b8ae1064fc4b95ec291f8f98 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Mon, 3 Feb 2014 19:23:51 -0500 Subject: [PATCH] no need for GCD tossing since completion happens on (explicit) main queue --- macosx/main.mm | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/macosx/main.mm b/macosx/main.mm index f1b02dabf..1c12b7f3c 100644 --- a/macosx/main.mm +++ b/macosx/main.mm @@ -233,17 +233,13 @@ void request_http(std::string url, std::function 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 func, std::fun } func(res); - dispatch_async(dispatch_get_main_queue(), ^ { - cb(); - }); + cb(); }]; }