Fix resource stream for collectible assemblies (dotnet/coreclr#22925)
authorJan Vorlicek <janvorli@microsoft.com>
Fri, 1 Mar 2019 11:10:49 +0000 (12:10 +0100)
committerGitHub <noreply@github.com>
Fri, 1 Mar 2019 11:10:49 +0000 (12:10 +0100)
commit06324d52ed7f23b2539d7240d5ed5073f736ca7f
tree2e3d074384eba2fa506391954d2d1b23083f08c8
parent67d6864a2bc2c8932f65e7562f6bcbfa75a7b247
parent4354843d3bd043247f40067dbc8e6efb1ef8c8ed
Fix resource stream for collectible assemblies (dotnet/coreclr#22925)

* Fix resource stream for collectible assemblies

The GetManifestResourceStream was returning a stream that didn't keep
the underlying assembly alive. For collectible assemblies, that means
that an assembly could be collected and the stream still kept,
potentially reading garbage.

The fix is to create a new stream type that stores a reference to the
underlying assembly, thus ensuring the proper lifetime management.

* Make the new stream class sealed

Commit migrated from https://github.com/dotnet/coreclr/commit/452c40d2338bcf3f9298d316b49fbd1389a70cd5