From b5f91d17daae5d65b26f436a7fa96a563fb3d67f Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Fri, 17 Oct 2014 18:48:18 +0800 Subject: [PATCH] Fix [Node:clipping -> Clipping to RenderTexture] crash --- .../Classes/ClippingNodeTest/ClippingNodeTest.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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();