Hi,
i have the suggestion to use NSAutoreleasePool for CCFileUtils functions, only for iOS devices obviously.
I know that cc2dx does not support multithreading now, but it should be usefull(like in my case).
for example:
without NSARpool
std::string CCFileUtils::getWriteablePath()
{
// save to document folder
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
std::string strRet = [documentsDirectory UTF8String];
strRet.append("/");
return strRet;
}
with NSARpool
std::string CCFileUtils::getWriteablePath()
{
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
// save to document folder
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
std::string strRet = [documentsDirectory UTF8String];
[pool release]; pool = nil;
strRet.append("/");
return strRet;
}
what do you think about this?
P.S.:if you find some grammar errors, replace them with smiles in your mind =)