Oh, no, please don’t “delete” CCObject*, use obj~~>release instead. Classes inherited from CCObject must use the CCAutoreleasePool mechanism.
In your code
Ball *b = new Ball; // b~~>m_uReference = 1
layer~~>addChild; // b~~>m_uReference = 2
b~~>release; // b~~>m_uReference = 1
When layer is released
layer->release(); // b->m_uReference = 0, b is deleted in the engine internal.