Przeglądaj źródła

Make a call to "CallDelayedReleaseHooks" after making a function call through "sq_call", normally after a call through the vm "CallDelayedReleaseHooks" is called but not through "sq_call" api.

mingodad 13 lat temu
rodzic
commit
5129f67137
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3 1
      SquiLu/squirrel/sqapi.cpp

+ 3 - 1
SquiLu/squirrel/sqapi.cpp

@@ -1337,7 +1337,9 @@ SQRESULT sq_call(HSQUIRRELVM v,SQInteger params,SQBool retval,SQBool raiseerror)
 	if(v->Call(v->GetUp(-(params+1)),params,v->_top-params,res,raiseerror?true:false)){
 
 		if(!v->_suspended) {
-			v->Pop(params);//pop closure and args
+			v->Pop(params);//pop closure and args
+			//collect garbage right after function call if any
+			_ss(v)->CallDelayedReleaseHooks(v);
 		}
 		if(retval){
 			v->Push(res); return SQ_OK;