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)