Browse Source

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

James Doran 11 năm trước cách đây
mục cha
commit
ae2c5c49b1

+ 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)