diff --git a/engine/vm.c b/engine/vm.c index df64b24..5ad25ab 100644 --- a/engine/vm.c +++ b/engine/vm.c @@ -5274,14 +5274,14 @@ PH7_PRIVATE sxi32 PH7_VmByteCodeExec(ph7_vm *pVm) { if(pInstance == 0) { PH7_VmMemoryError(&(*pVm)); } - /* Enable garbage collector */ - pInstance->iRef--; /* Check if a constructor is available */ pMethod = PH7_ClassExtractMethod(pClass, "__construct", sizeof("__construct") - 1); if(pMethod) { /* Call the class constructor */ PH7_VmCallClassMethod(&(*pVm), pInstance, pMethod, 0, 0, 0); } + /* Enable garbage collector */ + pInstance->iRef--; pArgs = ph7_new_array(&(*pVm)); sArgv = ph7_new_scalar(&(*pVm)); if(!pArgs || !sArgv) {