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
Post a Comment