ios - How to fix memory leak in AFNetworking 3.1? -


i'm testing app in instruments below code getting memory leak. please tell me how fix it.

nsurlsessionconfiguration *configuration = [nsurlsessionconfiguration defaultsessionconfiguration];  afhttpsessionmanager *manager = [[afhttpsessionmanager alloc]initwithsessionconfiguration:configuration]; 

you can try code:

static dispatch_once_t oncetoken;     dispatch_once(&oncetoken, ^{          nsurlsessionconfiguration *sessionconfiguration = [nsurlsessionconfiguration defaultsessionconfiguration];         sessionconfiguration.httpmaximumconnectionsperhost = 10;          self.manager = [[afurlsessionmanager alloc] initwithsessionconfiguration:sessionconfiguration]; }); 

Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -