[foundation] Remove duplicated code from UnmanagedMemoryStreamWithRef (#3769)

The base type, `UnmanagedMemoryStreamWithRef`, already handle the
reference to the `NSData` and the related `Dispose` logic
This commit is contained in:
Sebastien Pouliot 2018-03-19 08:51:10 -05:00 коммит произвёл GitHub
Родитель 7f46564727
Коммит dd01b347c2
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 1 добавлений и 9 удалений

Просмотреть файл

@ -130,7 +130,7 @@ namespace Foundation {
// Keeps a ref to the source NSData
//
unsafe class UnmanagedMemoryStreamWithRef : UnmanagedMemoryStream {
NSData source;
protected NSData source;
public UnmanagedMemoryStreamWithRef (NSData source) : base ((byte *)source.Bytes, (long)source.Length)
{
@ -149,19 +149,11 @@ namespace Foundation {
// displays an error if the NSMutableData changes while the stream is used
//
unsafe class UnmanagedMemoryStreamWithMutableRef : UnmanagedMemoryStreamWithRef {
NSData source;
IntPtr base_address;
public UnmanagedMemoryStreamWithMutableRef (NSData source) : base (source)
{
base_address = source.Bytes;
this.source = source;
}
protected override void Dispose (bool disposing)
{
source = null;
base.Dispose (disposing);
}
static void InvalidOperation ()