cocos2d/cocos2d-x — pull request #8659 by neil-wu (2014-10-13 06:41:59+00:00)
Title: Fix one memory leak of removeFromParentAndCleanup

//neilwu (wuyupeng2007(AT)gmail.com) modify
Because Widget only supports Widgets as children, so if child is not a widget,
when you call child->removeFromParentAndCleanup(), this will lead to memory leak!!!

The following code show detail info about this bug:
//....(TODO:load armature res)
UIImageView* pbg = UIImageView::create();
pbg->loadTexture("CloseNormal.png");
pbg->setPosition(ccp(200, 100));
addChild(pbg);
CCArmature* armature = CCArmature::create("demo_armature"); //TODO:you need preload som demo res
pbg->addNode(m_armature, 1, 111);

//check this:
armature->removeFromParentAndCleanup(true); //This will lead the bug.