(svn r26832) -Fix [Squirrel]: ensure instance variable of SQNativeClosure is properly initialized

This commit is contained in:
rubidium 2014-09-16 20:06:05 +00:00
parent ff880a420d
commit 5cec030d4d
2 changed files with 1 additions and 2 deletions

View File

@ -357,7 +357,6 @@ SQRESULT sq_arrayinsert(HSQUIRRELVM v,SQInteger idx,SQInteger destpos)
void sq_newclosure(HSQUIRRELVM v,SQFUNCTION func,SQUnsignedInteger nfreevars)
{
SQNativeClosure *nc = SQNativeClosure::Create(_ss(v), func);
nc->_nparamscheck = 0;
for(SQUnsignedInteger i = 0; i < nfreevars; i++) {
nc->_outervalues.push_back(v->Top());
v->Pop();

View File

@ -80,7 +80,7 @@ public:
struct SQNativeClosure : public CHAINABLE_OBJ
{
private:
SQNativeClosure(SQSharedState *ss,SQFUNCTION func){_function=func;INIT_CHAIN();ADD_TO_CHAIN(&_ss(this)->_gc_chain,this); }
SQNativeClosure(SQSharedState *ss,SQFUNCTION func) : _nparamscheck(0) {_function=func;INIT_CHAIN();ADD_TO_CHAIN(&_ss(this)->_gc_chain,this); }
public:
static SQNativeClosure *Create(SQSharedState *ss,SQFUNCTION func)
{