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

Cleanup orphaned widget models #167

Merged
merged 10 commits into from
Nov 19, 2024
Merged

Cleanup orphaned widget models #167

merged 10 commits into from
Nov 19, 2024

Conversation

cpsievert
Copy link
Collaborator

Closes #166

@cpsievert cpsievert force-pushed the cleanup-orphaned-widgets branch 4 times, most recently from 30f9b46 to ccb676b Compare November 18, 2024 16:21
…ated as a side-effect of a output render) when they're no longer needed (i.e., the next time the output renders or if the session closes)
@cpsievert cpsievert force-pushed the cleanup-orphaned-widgets branch from ccb676b to eedb1b8 Compare November 18, 2024 16:31
@cpsievert cpsievert force-pushed the cleanup-orphaned-widgets branch from a6886fb to 63d44d9 Compare November 18, 2024 17:15
Comment on lines -103 to -108
// Don't allow more than one .lmWidget container, which can happen
// when the view is displayed more than once
// TODO: It's probably better to get view(s) from m.views and .remove() them
while (el.childNodes.length > 1) {
el.removeChild(el.childNodes[0]);
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No longer needed now that we're properly closing the model (which deletes the view)

@cpsievert cpsievert force-pushed the cleanup-orphaned-widgets branch 3 times, most recently from 8992aec to 2f952ed Compare November 18, 2024 23:33
@cpsievert cpsievert force-pushed the cleanup-orphaned-widgets branch from 2f952ed to b10e675 Compare November 19, 2024 00:00
js/src/output.ts Outdated Show resolved Hide resolved
@jcheng5
Copy link
Collaborator

jcheng5 commented Nov 19, 2024

In case I didn't say this out loud when we met today, LGTM after you address those last little comments.

@cpsievert cpsievert merged commit 72d16f5 into main Nov 19, 2024
4 checks passed
@cpsievert cpsievert deleted the cleanup-orphaned-widgets branch November 19, 2024 21:57
cpsievert added a commit that referenced this pull request Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory leak when repeatedly initializing widgets within a render scope
2 participants