dynamic cast throws pointer is not std::__non_rtti_object

后端 未结 2 1706
有刺的猬
有刺的猬 2021-01-22 20:54

I\'m having problem with dynamic_cast. i just compiled my project and tested every thing in debug mode and then i tried compiling it in release mode, i have copied every configu

相关标签:
2条回答
  • 2021-01-22 21:30

    Does CCNode have any virtual functions? Are all elements of temp->getChildren()->begin() really CCNodes? Does temp->getChildren() return a reference? The latter is especially insidious: you call both temp->getChildren()->begin() and temp->getChildren()->end(). If getChildren() returns a copy, you're taking the begin of one copy and the end of another copy.

    0 讨论(0)
  • 2021-01-22 21:39

    In this case after many code changes I found out there has to be some bugs which show themselves when code is optimized (still don't know if it's compiler's mis optimization or my code has some problems but it's probably mine). and the main reason for that problem was with *l being NULL.

    0 讨论(0)
提交回复
热议问题