diff --git a/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp b/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp index 0f7054be65..2552a677c3 100644 --- a/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp +++ b/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp @@ -979,12 +979,16 @@ std::string ClippingToRenderTextureTest::subtitle() const void ClippingToRenderTextureTest::setup() { auto button = MenuItemFont::create("Reproduce bug", [&](Ref *sender) { + std::vector nodes; enumerateChildren("remove me [0-9]", [&](Node *node) { - this->removeChild(node); - this->reproduceBug(); + nodes.push_back(node); return false; + }); + for (auto node : nodes) + { + this->removeChild(node); } - ); + this->reproduceBug(); }); auto s = Director::getInstance()->getWinSize();