Bug #1526

By dumganhar Posted 2012-11-01 14:14

Solution:

<pre><code class="cplusplus">
in CCParticleExample.h

class CC_DLL CCParticleRain : public CCParticleSystemQuad
{
public:
CCParticleRain(){}
virtual ~CCParticleRain(){}
bool init(){ return initWithTotalParticles(1000); }
virtual bool initWithTotalParticles(unsigned int numberOfParticles);
static CCParticleRain * node()
{
return create();
}
static CCParticleRain * create()
{
CCParticleRain *pRet = new CCParticleRain();
if (pRet->init())
{
pRet->autorelease();
return pRet;
}
CC_SAFE_DELETE(pRet);
return NULL;
}
};
</code></pre>

to
<pre><code class="cplusplus">
in in CCParticleExample.cpp

CCParticleRain* CCParticleRain::node()
{
return CCParticleRain::create();
}

CCParticleRain* CCParticleRain::create()
{
CCParticleRain* pRet = new CCParticleRain();
if (pRet && pRet->init())
{
pRet->autorelease();
}
else
{
CC_SAFE_DELETE(pRet);
}
return pRet;
}

</code></pre>
I think TestJavascript will also crash on iphone, but i haven't tested.

Back