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

Do not redefine refreshCompleterState on each render #875

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

krassowski
Copy link
Member

Fixes #874

@krassowski krassowski added the bug Something isn't working label Jul 5, 2024
Copy link
Member

@dlqqq dlqqq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This should definitely be more performant, though I don't think the previous version suffered a memory leak; I think the garbage collector will deallocate functions defined at-render.

@dlqqq dlqqq enabled auto-merge (squash) July 8, 2024 15:59
@dlqqq dlqqq merged commit 43a0e8f into jupyterlab:main Jul 8, 2024
8 checks passed
@krassowski
Copy link
Member Author

The leak was not due to multiple function definitions (that as you say will be freed easily) but due to the signal staying connected (and thus not dispoed) to the old function as the new reference was not matching the reference of redefined function. In any case it was just a tiny leak.

@krassowski krassowski mentioned this pull request Jul 11, 2024
Marchlak pushed a commit to Marchlak/jupyter-ai that referenced this pull request Oct 28, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refreshCompleterState is needlessly redefined on each render of the settings page
2 participants