From 88f1686d40830d7f09d1d0e7ccb8fe8087569acb Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Sun, 18 Sep 2022 12:44:30 -0700 Subject: [PATCH] Ensure that we null out the stream for generate-multi-file --- sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs b/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs index 20487f45..4aec98f3 100644 --- a/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs +++ b/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs @@ -1137,6 +1137,11 @@ static void GenerateTransparentStructs(PInvokeGenerator generator, Stream? strea { sw.WriteLine('}'); } + + if (!leaveStreamOpen) + { + stream = null; + } } static (int srcSize, int dstSize, int sign) GetSizeAndSignOf(string type)