cocos2d / cocos2d-x

Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.
https://www.cocos.com/en/cocos2d-x
18.12k stars 7.05k forks source link

Addchild on NotificationNode without create Scene would be crash #16389

Open chlinxxoo opened 8 years ago

chlinxxoo commented 8 years ago

Steps to Reproduce:

  1. Do not create any Scene
  2. Director::setNotificationNode(nodeObj)
  3. Create Label/Scale9Sprite/Sprite as obj
  4. Director::getInstance()->getNotificationNode()->addChild(obj)

Trace: 58779f7a4542fdca5bebb4250a29a99ef74526ef c881a8a3540432113d4fe495ac2ae6b4fe9ca255

minggo commented 8 years ago

Director::getInstance()->getNotificationNode() is null if haven't invoked Director::setNotificationNode().

chlinxxoo commented 8 years ago

@minggo Sorry, I left out one step when I create this issue.I edit it one more time and upload the xcode trace when the issus happen.