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

Try to workaround the #281 when imagePlayer stopPlaying trigger the Combine Publisher during deallocating #287

Merged
merged 2 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,46 +54,33 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/SDWebImageSwiftUIDemo-watchOS WatchKit App">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "32E529362348A0DD00EA46FF"
BuildableName = "SDWebImageSwiftUIDemo-watchOS WatchKit App.app"
BlueprintName = "SDWebImageSwiftUIDemo-watchOS WatchKit App"
ReferencedContainer = "container:SDWebImageSwiftUI.xcodeproj">
</BuildableReference>
</RemoteRunnable>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/SDWebImageSwiftUIDemo-watchOS WatchKit App">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "32E529362348A0DD00EA46FF"
BuildableName = "SDWebImageSwiftUIDemo-watchOS WatchKit App.app"
BlueprintName = "SDWebImageSwiftUIDemo-watchOS WatchKit App"
ReferencedContainer = "container:SDWebImageSwiftUI.xcodeproj">
</BuildableReference>
</RemoteRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "32E529362348A0DD00EA46FF"
BuildableName = "SDWebImageSwiftUIDemo-watchOS WatchKit App.app"
BlueprintName = "SDWebImageSwiftUIDemo-watchOS WatchKit App"
ReferencedContainer = "container:SDWebImageSwiftUI.xcodeproj">
</BuildableReference>
</MacroExpansion>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down
1 change: 1 addition & 0 deletions SDWebImageSwiftUI/Classes/ImageManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

import SwiftUI
import Combine
import SDWebImage

/// A Image observable object for handle image load process. This drive the Source of Truth for image loading status.
Expand Down
5 changes: 1 addition & 4 deletions SDWebImageSwiftUI/Classes/ImagePlayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

import SwiftUI
import Combine
import SDWebImage

/// A Image observable object for handle aniamted image playback. This is used to avoid `@State` update may capture the View struct type and cause memory leak.
Expand All @@ -29,10 +30,6 @@ public final class ImagePlayer : ObservableObject {
/// Animation playback mode
public var playbackMode: SDAnimatedImagePlaybackMode = .normal

deinit {
player?.stopPlaying()
}

/// Current playing frame image
@Published public var currentFrame: PlatformImage?

Expand Down
1 change: 1 addition & 0 deletions SDWebImageSwiftUI/Classes/Indicator/Indicator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

import Foundation
import Combine
import SwiftUI

/// A type to build the indicator
Expand Down
Loading