diff --git a/scripting/javascript/bindings/js_bindings_chipmunk_manual.cpp b/scripting/javascript/bindings/js_bindings_chipmunk_manual.cpp index bc701cbe7e..c05238415b 100644 --- a/scripting/javascript/bindings/js_bindings_chipmunk_manual.cpp +++ b/scripting/javascript/bindings/js_bindings_chipmunk_manual.cpp @@ -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);