Enable garbage collector for Program class. This also partially fixes #47, as from now Program::__destruct() will be called automatically.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2019-03-19 12:52:36 +01:00
parent b60c1de4cf
commit 3d23d43040
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 2 additions and 0 deletions

View File

@ -5472,6 +5472,8 @@ 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) {