internal static void FinishPipelineRequest(HttpContext context) { HttpRuntime._theRuntime._firstRequestCompleted = true; context.RaiseOnRequestCompleted(); context.Request.Dispose(); context.Response.Dispose(); HttpApplication applicationInstance = context.ApplicationInstance; if (applicationInstance != null) { System.Web.ThreadContext threadContext = context.IndicateCompletionContext; if (threadContext != null && !threadContext.HasBeenDisassociatedFromThread) { lock (threadContext) { if (!threadContext.HasBeenDisassociatedFromThread) { threadContext.DisassociateFromCurrentThread(); context.IndicateCompletionContext = (System.Web.ThreadContext) null; context.InIndicateCompletion = false; } } } applicationInstance.ReleaseAppInstance(); } HttpRuntime.SetExecutionTimePerformanceCounter(context); HttpRuntime.UpdatePerfCounters(context.Response.StatusCode); if (EtwTrace.IsTraceEnabled(5, 1)) EtwTrace.Trace(EtwTraceType.ETW_TYPE_END_HANDLER, context.WorkerRequest); if (!HttpRuntime.HostingInitFailed) return; HttpRuntime.ShutdownAppDomain(ApplicationShutdownReason.HostingEnvironment, "HostingInit error"); }