File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Modules/Presentation/Features/Accounts/Sources/Accounts/Ads/ViewModel Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,11 @@ final public class AdsSlotViewModel: ObservableObject {
2929 self . appEnvironmentUseCase = appEnvironmentUseCase
3030 }
3131
32+ deinit {
33+ monitorAdsSlotChangesTask? . cancel ( )
34+ monitorAdsSlotChangesTask = nil
35+ }
36+
3237 // MARK: Setup
3338 func setupSubscriptions( ) {
3439 NotificationCenter . default
@@ -59,6 +64,7 @@ final public class AdsSlotViewModel: ObservableObject {
5964
6065 // MARK: Ads Slot changes
6166 func monitorAdsSlotChanges( ) {
67+ monitorAdsSlotChangesTask? . cancel ( )
6268 monitorAdsSlotChangesTask = Task { [ weak self, adsSlotChangeStream] in
6369 for await newAdsSlotConfig in adsSlotChangeStream. adsSlotStream {
6470 await self ? . updateAdsSlot ( newAdsSlotConfig)
You can’t perform that action at this time.
0 commit comments