std::string str = “You pressed the close button. Windows Store Apps do not implement a close button.”;
CCArray *pArray = CCArray::create();
for (int i=0; i<1000000; i++) {
CCString *pStr = new CCString();
pStr->initWithFormat("%s", str.c_str());
pArray->addObject(pStr);
pStr->release();
}
入上述代码。按照正常情况new出来的CCstring将在这帧结束后随着CCArray被释放而释放,但是我用xcode监测内存变化,并没有减少。请问这个是啥原因呢。
额刚用模拟器试试,xcode内存检测显示下一帧内存还是有下降到原来的水平,但是真机5S还是不回下降啊。