CombineCommunity / CombineExt

CombineExt provides a collection of operators, publishers and utilities for Combine, that are not provided by Apple themselves, but are common in other Reactive Frameworks and standards.
https://combine.community
MIT License
1.72k stars 151 forks source link

Share replay leak #86

Closed jabeattie closed 3 years ago

jabeattie commented 3 years ago

Attempts to fix https://github.com/CombineCommunity/CombineExt/issues/85

I added a test that proved that the source publisher was retained after everything had been nilled out/released.

I then added the cancel() method call in the forwardCompletionToBuffer method inside ReplaySubject.Subscription as this causes the subscription to then be released.

As I mentioned in the issue I raised, I'm not familiar enough to know what the other implications of this could be (it seems to all work fine for me in my project) so would appreciate any help or comments.

freak4pc commented 3 years ago

Hey @jasdev - mind looking into this, as you know ReplaySubject well enough here?

Thanks @jabeattie :)

codecov[bot] commented 3 years ago

Codecov Report

Merging #86 (11cedcd) into main (8a070de) will increase coverage by 0.01%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #86      +/-   ##
==========================================
+ Coverage   97.10%   97.12%   +0.01%     
==========================================
  Files          62       62              
  Lines        3315     3336      +21     
==========================================
+ Hits         3219     3240      +21     
  Misses         96       96              
Impacted Files Coverage Δ
Sources/Subjects/ReplaySubject.swift 100.00% <100.00%> (ø)
Tests/ShareReplayTests.swift 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 8a070de...11cedcd. Read the comment docs.