Avoiding pointer point to a destroyed variable.

This commit is contained in:
James Chen 2012-11-22 17:36:49 +08:00
parent 692d16f296
commit c0097db48c
1 changed files with 2 additions and 1 deletions

View File

@ -430,8 +430,9 @@ JSBool JSPROXY_CCPhysicsSprite_spriteWithSpriteFrame__static(JSContext *cx, uint
JSBool JSPROXY_CCPhysicsSprite_spriteWithSpriteFrameName__static(JSContext *cx, uint32_t argc, jsval *vp) {
jsval *argv = JS_ARGV(cx, vp);
const char* arg0;
std::string arg0_tmp;
if (argc >= 1) {
std::string arg0_tmp = jsval_to_std_string(cx, argv[0]); arg0 = arg0_tmp.c_str();
arg0_tmp = jsval_to_std_string(cx, argv[0]); arg0 = arg0_tmp.c_str();
}
CCPhysicsSprite* ret = new CCPhysicsSprite();
ret->initWithSpriteFrameName(arg0);