Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #6661: Moved content writing from Flush to new method FinalizeContent #8266

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -161,7 +161,8 @@ public void Compile(Stream stream, object content, TargetPlatform targetPlatform
{
using (var writer = new ContentWriter(this, stream, targetPlatform, targetProfile, compressContent, rootDirectory, referenceRelocationPath))
{
writer.WriteObject(content);
writer.WriteObject(content);
writer.FinalizeContent();
writer.Flush();
}
}
Expand Down
Expand Up @@ -118,14 +118,14 @@ protected override void Dispose(bool disposing)
}

base.Dispose(disposing);
}
}

/// <summary>
/// All content has been written, so now finalize the header, footer and anything else that needs finalizing.
/// </summary>
public override void Flush()
{
// Write shared resources to the end of body stream
/// </summary>
public void FinalizeContent()
{
// Write shared resources to the end of body stream
WriteSharedResources();

using (var contentStream = new MemoryStream())
Expand Down Expand Up @@ -172,7 +172,14 @@ public override void Flush()
if (compressedStream != null)
compressedStream.Dispose();
}
}
}
}

/// <summary>
/// Clears buffer using BinaryWriter's flush method
/// </summary>
public override void Flush()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this anymore? If it's defaulting to the virtual base call anyways.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If all it's doing is calling the base, then it's not needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can certainly go and delete it if it's only calling base and has no other purpose

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted! Apologies for the delay.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not a maintainer so you would need to ping @harry-cpp / @mrhelmut to review the PR(s).

{
base.Flush();
}

Expand Down