-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.x: Allow Single.zip and Maybe.zip result to be garbage collected #7196
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please adjust the PR for both classes.
src/main/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeZipArray.java
Outdated
Show resolved
Hide resolved
src/main/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeZipArray.java
Outdated
Show resolved
Hide resolved
@akarnokd Sorry, hit re-review accidentally 🙈 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like I forgot about the case when the consumer retains the whole array reference, thus clearing it out can cause late errors.
Let's make values
non-final and null it out instead as you originally suggested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I committed a few changes to fix race conditions with the changes
Codecov Report
@@ Coverage Diff @@
## 3.x #7196 +/- ##
============================================
+ Coverage 99.49% 99.52% +0.03%
- Complexity 6752 6756 +4
============================================
Files 747 747
Lines 47350 47387 +37
Branches 6367 6384 +17
============================================
+ Hits 47110 47163 +53
+ Misses 112 101 -11
+ Partials 128 123 -5
Continue to review full report at Codecov.
|
Resolves #7195