Closing a repository document leaks everything#439
Open
mattlilek wants to merge 3 commits intorowanj:masterfrom
mattlilek:stop_leaking_everything
Open
Closing a repository document leaks everything#439mattlilek wants to merge 3 commits intorowanj:masterfrom mattlilek:stop_leaking_everything
mattlilek wants to merge 3 commits intorowanj:masterfrom
mattlilek:stop_leaking_everything
Conversation
…er 'super controller', and the only place these objects are ever created is within the PBGitWindowController...which contains a strong, owning reference to these objects creating a retain cycle.
…ts by breaking a retain cycle between the PBGitHistoryList and its internal PBGitHistoryGrapher. The grapher maintained a strong reference to it's "delegate", but is only ever owned by the same object. Make the "delegate" a weak reference. The two places it's used, create a strong reference while it's used. Finally, -[PBGitRepository close] calls -[PBGitHistoryList cleanup] but so does -[PBGitHistoryList dealloc]. Avoid an uncaught exception/crash by nil-ing out the currentRevList after we've cleaned up as it's no longer valid.
means many more objects are getting released at the proper time.
|
Side note, make sure that you're not weak-ing things that can't be weak — we have been bit by |
|
I already fixed all those leaks and cycles about two years ago: #224 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closing a repository's window doesn't return any memory to the system. It looks like there's retain cycles everywhere.
This branch doesn't yet eliminate all leaks but fixes some big ones.