CCLayer* layer = CCLayer::create(); CCSprite* sprite = CCSprite::create("image.png"); layer->addChild(sprite);
layer->release();This will decrement the reference count for the layer and delete it from memory if there are no more references to it. The package library for CCLayer is part of the Cocos2d-x game development framework, which is an open-source library that provides tools for creating 2D games on a variety of platforms including iOS, Android, Windows, and Mac OS X.