From aed6adb6e9f5b313c7cf6158bcd8fa5adaad7ef1 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 6 Oct 2023 21:58:15 -0700 Subject: [PATCH] fix Fetch.JobQueue.consolidateErrors --- src/Package/Fetch.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Package/Fetch.zig b/src/Package/Fetch.zig index 93ac2f4f01..2746ba9c03 100644 --- a/src/Package/Fetch.zig +++ b/src/Package/Fetch.zig @@ -93,9 +93,12 @@ pub const JobQueue = struct { /// Dumps all subsequent error bundles into the first one. pub fn consolidateErrors(jq: *JobQueue) !void { const root = &jq.all_fetches.items[0].error_bundle; + const gpa = root.gpa; for (jq.all_fetches.items[1..]) |fetch| { if (fetch.error_bundle.root_list.items.len > 0) { - try root.addBundleAsRoots(fetch.error_bundle.tmpBundle()); + var bundle = try fetch.error_bundle.toOwnedBundle(""); + defer bundle.deinit(gpa); + try root.addBundleAsRoots(bundle); } } }