From 7c422d37e5b044ea7f9b450f547688be2b6e248e Mon Sep 17 00:00:00 2001 From: Elinor Fung <47805090+elinor-fung@users.noreply.github.com> Date: Mon, 27 Jul 2020 18:12:25 -0700 Subject: [PATCH] Fix releasing of file handle in binder tracing (#39974) --- src/coreclr/src/binder/bindertracing.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/coreclr/src/binder/bindertracing.cpp b/src/coreclr/src/binder/bindertracing.cpp index 2e5c83d..be09ebc 100644 --- a/src/coreclr/src/binder/bindertracing.cpp +++ b/src/coreclr/src/binder/bindertracing.cpp @@ -216,14 +216,14 @@ namespace BinderTracing AssemblyBindOperation::~AssemblyBindOperation() { - if (!BinderTracing::IsEnabled() || ShouldIgnoreBind()) - return; - - // Make sure the bind request is populated. Tracing may have been enabled mid-bind. - if (!m_populatedBindRequest) - PopulateBindRequest(m_bindRequest); + if (BinderTracing::IsEnabled() && !ShouldIgnoreBind()) + { + // Make sure the bind request is populated. Tracing may have been enabled mid-bind. + if (!m_populatedBindRequest) + PopulateBindRequest(m_bindRequest); - FireAssemblyLoadStop(m_bindRequest, m_resultAssembly, m_cached); + FireAssemblyLoadStop(m_bindRequest, m_resultAssembly, m_cached); + } if (m_resultAssembly != nullptr) m_resultAssembly->Release(); -- 2.7.4