Skip to content

Commit

Permalink
Merge pull request #190 from wwt/workflow-abandon-is-causing-memory-s…
Browse files Browse the repository at this point in the history
…elf-when-weakly-referenced

Fixes an issue where holding self weakly is causing a memory leak when calling workflow.abandon
  • Loading branch information
morganzellers authored Mar 14, 2022
2 parents 500f72f + f17d99d commit f69e8ac
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ extension AnyWorkflow {
*/
public func abandon(animated: Bool = true, onFinish:(() -> Void)? = nil) {
if let presenter = orchestrationResponder as? UIKitPresenter {
presenter.abandon(self, animated: animated) { [weak self] in
self?._abandon()
presenter.abandon(self, animated: animated) { [self] in
self._abandon()
onFinish?()
}
} else if let responder = orchestrationResponder {
Expand Down

0 comments on commit f69e8ac

Please sign in to comment.