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

🐞 CodeFileDocument Not Releasing Correctly #1794

Closed
thecoolwinter opened this issue Jul 4, 2024 · 1 comment · Fixed by #1808
Closed

🐞 CodeFileDocument Not Releasing Correctly #1794

thecoolwinter opened this issue Jul 4, 2024 · 1 comment · Fixed by #1808
Assignees
Labels
bug Something isn't working workspace

Comments

@thecoolwinter
Copy link
Collaborator

Description

There's a strong reference cycle somewhere causing code files to not release correctly. This was noted in a discord discussion.

To Reproduce

  • Open a file
  • Move around
  • Close the file
  • Check memory usage (it didn't go down)

Expected Behavior

The file is released along with all associated memory.

Version Information

CodeEdit: [0.1.0]

Additional Context

No response

Screenshots

No response

@thecoolwinter thecoolwinter added the bug Something isn't working label Jul 4, 2024
thecoolwinter added a commit to CodeEditApp/CodeEditSourceEditor that referenced this issue Jul 4, 2024
### Description

Fixes a strong reference cycle in `TextViewController` causing it to not
release when removed from the view heirarchy.

### Related Issues

* CodeEditApp/CodeEdit#1794

### Checklist

<!--- Add things that are not yet implemented above -->

- [x] I read and understood the [contributing
guide](https://github.com/CodeEditApp/CodeEdit/blob/main/CONTRIBUTING.md)
as well as the [code of
conduct](https://github.com/CodeEditApp/CodeEdit/blob/main/CODE_OF_CONDUCT.md)
- [x] The issues this PR addresses are related to each other
- [x] My changes generate no new warnings
- [x] My code builds and runs on my machine
- [x] My changes are all related to the related issue above
- [x] I documented my code

### Screenshots

Stable memory usage in the example app (mem jumps are opening & closing
a large file a few times):
![Screenshot 2024-07-03 at 8 22
20 PM](https://github.com/CodeEditApp/CodeEditSourceEditor/assets/35942988/7532e0f5-f72e-44b5-ac8c-5f194736d3d4)
@thecoolwinter
Copy link
Collaborator Author

After some investigation there's two things not releasing:

  • CodeFileDocument isn't being removed from the document controller after closing a tab
  • WorkspaceDocument isn't being released after closing a workspace window.

The CodeFileDocument problem is a pretty quick fix, but there's a lot of strong references to the WorkspaceDocument that need to be sorted through to find the reference cycle. I'll be working on this.

@thecoolwinter thecoolwinter self-assigned this Jul 4, 2024
@thecoolwinter thecoolwinter moved this from 🆕 New to 🏃‍♂️ In Progress in CodeEdit Project Jul 4, 2024
@github-project-automation github-project-automation bot moved this from 🏃‍♂️ In Progress to 🏁 Complete in CodeEdit Project Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working workspace
Projects
Status: 🏁 Complete
Development

Successfully merging a pull request may close this issue.

1 participant