Skip to content

Commit

Permalink
Fix a leak related to use of function used in a closure
Browse files Browse the repository at this point in the history
  • Loading branch information
Amol Prabhu committed Aug 8, 2024
1 parent 0eda6f3 commit af5b76c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apollo-ios/Sources/Apollo/ApolloStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,12 @@ public class ApolloStore {

public class ReadTransaction {
fileprivate let cache: any NormalizedCache

fileprivate lazy var loader: DataLoader<CacheKey, Record> = DataLoader { [weak self] batchLoad in
guard let self else { return [:] }
return try cache.loadRecords(forKeys: batchLoad)
}

fileprivate lazy var loader: DataLoader<CacheKey, Record> = DataLoader(self.cache.loadRecords)
fileprivate lazy var executor = GraphQLExecutor(
executionSource: CacheDataExecutionSource(transaction: self)
)
Expand Down

0 comments on commit af5b76c

Please sign in to comment.