Restore correct order of terminated flag check

This commit is contained in:
Dávid Karnok
2017-04-06 19:15:12 +02:00
committed by Rossen Stoyanchev
parent 43eea41dd6
commit 68cc57549a

View File

@@ -274,7 +274,10 @@ class ReactiveTypeHandler {
this.elementRef.lazySet(null);
return;
}
// Check terminal signal before processing element..
boolean isTerminated = this.terminated;
Object element = this.elementRef.get();
if (element != null) {
this.elementRef.lazySet(null);
@@ -291,7 +294,7 @@ class ReactiveTypeHandler {
}
}
if (this.terminated) {
if (isTerminated) {
this.done = true;
Throwable ex = this.error;
this.error = null;