From 9bcc66912abd6b05e8d32c037d40c7fab6cc4e23 Mon Sep 17 00:00:00 2001 From: minggo Date: Mon, 30 Jun 2014 20:45:01 +0800 Subject: [PATCH] fix crash cause by std::regex --- cocos/2d/CCNode.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cocos/2d/CCNode.cpp b/cocos/2d/CCNode.cpp index 240bab5f60..57911385f9 100644 --- a/cocos/2d/CCNode.cpp +++ b/cocos/2d/CCNode.cpp @@ -946,7 +946,8 @@ bool Node::doEnumerate(std::string name, std::function callback) bool ret = false; for (const auto& child : _children) { - if(std::regex_match(child->_name, std::regex(searchName))) + // should add ::std::regex_constants::basic for std::regex to avoid crash on Android and windows + if(std::regex_match(child->_name, std::regex(searchName, ::std::regex_constants::basic))) { if (!needRecursive) {