From 31d7e29d73b6700d8f0b349bc051954c4c463daf Mon Sep 17 00:00:00 2001 From: Guilherme Batalheiro Date: Thu, 14 Nov 2024 06:24:40 +0100 Subject: [PATCH] fix(p.lua): ensure file handle is closed with zero samples --- src/jit/p.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/src/jit/p.lua b/src/jit/p.lua index 36f836c5..5a503d8f 100644 --- a/src/jit/p.lua +++ b/src/jit/p.lua @@ -227,6 +227,7 @@ local function prof_finish() local samples = prof_samples if samples == 0 then if prof_raw ~= true then out:write("[No samples collected]\n") end + if out ~= stdout then out:close() end return end if prof_ann then