Skip to content
This repository was archived by the owner on Nov 13, 2026. It is now read-only.

Merge changes from TFS - #1319

Merged
jkotas merged 1 commit into
dotnet:nmirrorfrom
dotnet-bot:from-tfs
May 24, 2016
Merged

jkotas merged 1 commit into
dotnet:nmirrorfrom
dotnet-bot:from-tfs

Conversation

@dotnet-bot

Copy link
Copy Markdown
Collaborator

No description provided.

After un-marshaling the object reset the stream to the beginning. This addresses an issue causing the Threading\FirstParty\FTMThreadingTests to fail. What I suspect is happening although I can't verify this in the debugger is that when we create the stream we don't zero it out so it may contain contents of a previous stream that has already been released.  So if we don't reset the stream after we have un-marshaled the object and call CoReleaseMarshalData from the finalizer the stream may be positioned at another object and CoReleaseMarshalData may be releasing that object instead of the actual one that was written to the beginning of the stream.

Updating QueryInterface to call AddRef on the instance.

Updating Read and Write to use Buffer.MemoryCopy which should be faster.

Updating CopyTo to check the return value of Read and Write.

[tfs-changeset: 1607790]
@jkotas
jkotas merged commit 4d19f11 into dotnet:nmirror May 24, 2016
@dotnet-bot
dotnet-bot deleted the from-tfs branch May 24, 2016 22:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants