mirror of https://github.com/axmolengine/axmol.git
Avoiding pointer point to a destroyed variable.
This commit is contained in:
parent
692d16f296
commit
c0097db48c
|
@ -430,8 +430,9 @@ JSBool JSPROXY_CCPhysicsSprite_spriteWithSpriteFrame__static(JSContext *cx, uint
|
||||||
JSBool JSPROXY_CCPhysicsSprite_spriteWithSpriteFrameName__static(JSContext *cx, uint32_t argc, jsval *vp) {
|
JSBool JSPROXY_CCPhysicsSprite_spriteWithSpriteFrameName__static(JSContext *cx, uint32_t argc, jsval *vp) {
|
||||||
jsval *argv = JS_ARGV(cx, vp);
|
jsval *argv = JS_ARGV(cx, vp);
|
||||||
const char* arg0;
|
const char* arg0;
|
||||||
|
std::string arg0_tmp;
|
||||||
if (argc >= 1) {
|
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();
|
CCPhysicsSprite* ret = new CCPhysicsSprite();
|
||||||
ret->initWithSpriteFrameName(arg0);
|
ret->initWithSpriteFrameName(arg0);
|
||||||
|
|
Loading…
Reference in New Issue