浏览代码

Small memory optimization to Producer<T>.

Bart De Smet 10 年之前
父节点
当前提交
3ac2ca4344
共有 1 个文件被更改,包括 1 次插入1 次删除
  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