BADF00D / DisposableFixer

This is a Visual Studio Extension and NuGet package that should identify and fix problems as memleaks while using IDisposables.
Other
35 stars 7 forks source link

ToReactiveProperty yields an IDisposable that is not marked as not disposed #28

Closed dscopra closed 7 years ago

dscopra commented 7 years ago

image

ReactiveCollection implements IDisposable

BADF00D commented 7 years ago

I can't reproduce the error. Everything works as expected.

image

using System;
using System.Reactive.Linq;
using System.Linq;
using Reactive.Bindings;

namespace DisFixerTest.MethodChaining {
    class LastMethodReturnsAnDisposable {
        private ReactiveCollection<IAmNotDispoable> _collection;
        public LastMethodReturnsAnDisposable(IObservable<int> stream) {
            _collection = stream
                .Select(i => new Implementation())
                .OfType<IAmNotDispoable>()
                .ToReactiveCollection();
        }
    }
    public interface IAmNotDispoable {
    }     
    public class Implementation : IAmNotDispoable {
    }
}
dscopra commented 7 years ago

Version 0.22 doesn't seem to have this problem anymore.