From 32121abde308c046b6821e8ec9f5f6e4dce3c04c Mon Sep 17 00:00:00 2001 From: Justin Kotalik Date: Fri, 22 Jun 2018 15:29:28 -0700 Subject: [PATCH] Fixes exit(0) with hostable webcore (#966) --- .../InProcessRequestHandler/inprocessapplication.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/AspNetCoreModuleV2/InProcessRequestHandler/inprocessapplication.cpp b/src/AspNetCoreModuleV2/InProcessRequestHandler/inprocessapplication.cpp index 0d5ce7670a..4a3fd9901d 100644 --- a/src/AspNetCoreModuleV2/InProcessRequestHandler/inprocessapplication.cpp +++ b/src/AspNetCoreModuleV2/InProcessRequestHandler/inprocessapplication.cpp @@ -243,7 +243,13 @@ IN_PROCESS_APPLICATION::Recycle( // Try to graceful shutdown the managed application // and call exit to terminate current process ShutDown(); - exit(0); + + // If we set a static callback, we don't want to kill the current process as + // that will kill the test process and means we are running in hostable webcore mode. + if (s_fMainCallback == NULL) + { + exit(0); + } } }