Skip to content
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

Adopt AnyObject in RoutingProvider protocol #4744

Open
wants to merge 2 commits into
base: lts/v2
Choose a base branch
from

Conversation

kried
Copy link
Contributor

@kried kried commented Feb 4, 2025

Description

Adds the requirement for AnyObject to RoutingProvider protocol

Implementation

RouteController keeps a reference to the protocol
var customRoutingProvider: RoutingProvider? = nil

Without AnyObject, Swift boxed values into an existential container in RouteController. With AnyObject, only reference types can implement RoutingProvider.

Xcode memory graph previously showed customRoutingProvider as self reference, although there were no retain cycles.

Before After

@kried kried self-assigned this Feb 4, 2025
@kried kried requested a review from a team as a code owner February 4, 2025 16:14
Copy link

codecov bot commented Feb 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.02%. Comparing base (496bbda) to head (c29c7f5).

Impacted file tree graph

@@            Coverage Diff             @@
##           lts/v2    #4744      +/-   ##
==========================================
- Coverage   60.04%   60.02%   -0.03%     
==========================================
  Files         189      189              
  Lines       21326    21326              
==========================================
- Hits        12806    12800       -6     
- Misses       8520     8526       +6     

see 3 files with indirect coverage changes

@kried kried force-pushed the kried/v2/NAVIOS-2086 branch from 5d768b0 to c29c7f5 Compare February 4, 2025 21:19
@ArtemStepuk
Copy link
Contributor

thank you! just for understanding - we didn't have the leak, but the memory graph showed self reference on the RerouteController?

(and now the graph is clean)

@kried kried added the ⚠️ DO NOT MERGE PR should not be merged! label Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚠️ DO NOT MERGE PR should not be merged!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants