Преглед на файлове

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)