Skip to content

Commit

Permalink
fix: change from unowned self to weak self
Browse files Browse the repository at this point in the history
  • Loading branch information
makinosp committed Oct 18, 2024
1 parent 41b3c1e commit 956da96
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/VRCKit/Services/WorldService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public final actor WorldService: APIService, WorldServiceProtocol {
public func fetchFavoritedWorlds() async throws -> [FavoriteWorld] {
try await withThrowingTaskGroup(of: FavoriteWorldsWithOffset.self) { taskGroup in
for offset in Array(stride(from: 0, to: maxCount, by: limit)) {
taskGroup.addTask { [unowned self] in
taskGroup.addTask { [weak self] in
guard let self = self else { return (offset, []) }
let worlds = try await fetchFavoritedWorlds(n: limit, offset: offset)
return (offset, worlds)
}
Expand Down

0 comments on commit 956da96

Please sign in to comment.