From 758ace0d1ab651e6af786551140baa89e923180c Mon Sep 17 00:00:00 2001 From: belliash Date: Tue, 4 Sep 2018 08:49:38 +0200 Subject: [PATCH] Shutdown library properly on error. --- engine/vm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/vm.c b/engine/vm.c index efc7b12..41b76c2 100644 --- a/engine/vm.c +++ b/engine/vm.c @@ -1882,8 +1882,8 @@ PH7_PRIVATE sxi32 PH7_VmMemoryError( /* Consume the error message */ VmCallErrorHandler(&(*pVm), &sWorker); } - /* Release the VM gracefully and abort script execution */ - PH7_VmRelease(pVm); + /* Shutdown library and abort script execution */ + ph7_lib_shutdown(); exit(255); } /* @@ -1964,8 +1964,8 @@ PH7_PRIVATE sxi32 PH7_VmGenericError( rc = VmCallErrorHandler(&(*pVm), &sWorker); } if(iErr == PH7_CTX_ERR) { - /* Release the VM gracefully and abort script execution */ - PH7_VmRelease(pVm); + /* Shutdown library and abort script execution */ + ph7_lib_shutdown(); exit(255); } return rc;