Browse Source

Small memory optimization to Producer<T>.

Bart De Smet 10 years ago
parent
commit
3ac2ca4344
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Rx.NET/Source/System.Reactive.Core/Reactive/Internal/Producer.cs

+ 1 - 1
Rx.NET/Source/System.Reactive.Core/Reactive/Internal/Producer.cs

@@ -45,7 +45,7 @@ namespace System.Reactive
             state.sink = new SingleAssignmentDisposable();
             state.subscription = new SingleAssignmentDisposable();
 
-            var d = new CompositeDisposable(2) { state.sink, state.subscription };
+            var d = StableCompositeDisposable.Create(state.sink, state.subscription);
 
             //
             // See AutoDetachObserver.cs for more information on the safeguarding requirement and