Skip to content

Commit

Permalink
Fix HomeViewController retain cycle (#2462)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/414235014887631/1206561582798187/f
Tech Design URL:
CC:

Description:

This PR fixes an issue with every HomeViewController instance being affected by a retain cycle.
  • Loading branch information
samsymons authored Feb 9, 2024
1 parent 5b7ae97 commit e3c0b6c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions DuckDuckGo/HomeCollectionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,12 @@ class HomeCollectionView: UICollectionView {

case .favorites:
let renderer = FavoritesHomeViewSectionRenderer(viewModel: favoritesViewModel)
renderer.onFaviconMissing = { _ in
controller.faviconsFetcherOnboarding.presentOnboardingIfNeeded(from: controller)
renderer.onFaviconMissing = { [weak self] _ in
guard let self else {
return
}

self.controller.faviconsFetcherOnboarding.presentOnboardingIfNeeded(from: self.controller)
}
renderers.install(renderer: renderer)

Expand Down

0 comments on commit e3c0b6c

Please sign in to comment.