Skip to content

Commit

Permalink
Merge pull request dotnet#410 from qmfrederik/main
Browse files Browse the repository at this point in the history
Ensure that we null out the stream for generate-multi-file
  • Loading branch information
tannergooding committed Dec 6, 2022
2 parents 9d084eb + ddf82c0 commit b9840c5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,11 @@ public void Close()
Debug.Assert(stream is not null);
CloseOutputBuilder(stream, outputBuilder, isMethodClass, leaveStreamOpen, emitNamespaceDeclaration);
emitNamespaceDeclaration = false;

if (_config.GenerateMultipleFiles)
{
stream = null;
}
}

if (_config.GenerateHelperTypes && (_config.OutputMode == PInvokeGeneratorOutputMode.CSharp))
Expand Down

0 comments on commit b9840c5

Please sign in to comment.