Skip to content

Let the regl object tree be garbage collected on Plotly.restyle #1479

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

Merged
merged 1 commit into from
Mar 17, 2017

Conversation

monfera
Copy link
Contributor

@monfera monfera commented Mar 15, 2017

Having tried more verbose approaches such as keeping around both the <canvas> element and the regl object, or just the <canvas> element, the simple and effective route from a memory and object lifecycle point of view was to let the previously created regl object be garbage collected. This is achieved by ensuring a fresh <canvas> is created and the previous one gets garbage collected (again, after trying some alternatives), including its attached gl context and regl object.

Also, the snapshot making code should no longer remove the canvas as it's not kept around on rerendering.

@monfera
Copy link
Contributor Author

monfera commented Mar 15, 2017

Getting a seemingly unrelated CI failure on this 3 times in a row, mostly the gl3d_z-range.svg thingie

@monfera monfera added status: reviewable bug something broken labels Mar 15, 2017
@monfera monfera self-assigned this Mar 15, 2017
@etpinard etpinard added this to the v1.25.0 milestone Mar 17, 2017
Copy link
Contributor

@etpinard etpinard left a comment

Choose a reason for hiding this comment

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

Great detective work 🔬

💃

@monfera monfera merged commit 9f4823b into master Mar 17, 2017
@monfera monfera deleted the gc-regl-context branch March 17, 2017 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants