From 113d6cd87a59b067094463f574d0e22c672f7bdc Mon Sep 17 00:00:00 2001 From: Vern Paxson Date: Fri, 6 May 2022 07:47:45 -0700 Subject: [PATCH] tidy up after generating profile --- src/ScriptProfile.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ScriptProfile.cc b/src/ScriptProfile.cc index 198d6cd268..a08071e5be 100644 --- a/src/ScriptProfile.cc +++ b/src/ScriptProfile.cc @@ -117,6 +117,9 @@ ScriptProfileMgr::~ScriptProfileMgr() fprintf(f, "non-scripts\t\tTOTAL\t%d\t%.06f\t%.06f\t%lld\t%lld\n", non_scripts.NumCalls(), non_scripts.CPUTime(), 0.0, non_scripts.Memory(), 0LL); + + if ( f != stdout ) + fclose(f); } void ScriptProfileMgr::StartInvocation(const Func* f, const detail::StmtPtr& body)