Ho due blocchi GCD
asincroni. Il primo è per il thread in background, il secondo viene eseguito sul thread principale. Funziona alla grande, ma ho visto da qualche parte che avrei potuto doverli rilasciare usando dispatch_release()
. Es .:dispatch_queue_t deve essere rilasciato usando dispatch_release()?
// Use gcd
dispatch_queue_t queue = dispatch_queue_create("com.awesome", 0);
dispatch_queue_t main = dispatch_get_main_queue();
// do the long running work in bg async queue
// within that, call to update UI on main thread.
dispatch_async(queue, ^{
// Do work in the background
// Release
dispatch_release(queue);
dispatch_async(main, ^{
// Main
// Release
dispatch_release(main);
});//end
});//end
È vero? Devo rilasciarli qui?
Per i commenti nel file di intestazione è necessario richiamare dispatch_release() su qualsiasi coda che si crea. – BonanzaDriver