浏览代码

Fixed Buffer race condition where timers could be created out of order and cause timers to stop firing.

James Doran 11 年之前
父节点
当前提交
ae2c5c49b1
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 5 5
      Rx.NET/Source/System.Reactive.Linq/Reactive/Linq/Observable/Buffer.cs

+ 5 - 5
Rx.NET/Source/System.Reactive.Linq/Reactive/Linq/Observable/Buffer.cs

@@ -404,9 +404,9 @@ namespace System.Reactive.Linq.ObservableImpl
                     var res = _s;
                     _s = new List<TSource>();
                     base._observer.OnNext(res);
-                }
 
-                CreateTimer(newId);
+                    CreateTimer(newId);
+                }
 
                 return d;
             }
@@ -431,10 +431,10 @@ namespace System.Reactive.Linq.ObservableImpl
                         _s = new List<TSource>();
                         base._observer.OnNext(res);
                     }
-                }
 
-                if (newWindow)
-                    CreateTimer(newId);
+                    if (newWindow)
+                        CreateTimer(newId);
+                }
             }
 
             public void OnError(Exception error)