Fixes an issue where holding self weakly is causing a memory leak when calling workflow.abandon #190
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Abstract
There was an issue where calling
workflow.abandon
in theonFinish
completion handler of a launched workflow could fail to be called because theworkflow
had already been deallocated. This caused ViewControllers to remain allocated. This issue did not occur when the workflow was abandoned within the workflow, but did reliably occur when trying to clean up when finishing.By making this a strong reference, we can see in the memory graph that the ViewControllers are being reliably deallocated. I attached a video of me doing just this. Starting with the current code and showing all of the ViewControllers still in memory and then re-running with the strong reference showing all of the ViewControllers no longer in memory.
Video
video showing memory graph debugging
Linked Issue: Closes #41
Checklist: