From: Elinor Fung <47805090+elinor-fung@users.noreply.github.com> Date: Tue, 28 Jul 2020 01:12:25 +0000 (-0700) Subject: Fix releasing of file handle in binder tracing (#39974) X-Git-Tag: submit/tizen/20210909.063632~6397 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7c422d37e5b044ea7f9b450f547688be2b6e248e;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Fix releasing of file handle in binder tracing (#39974) --- 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();