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

fixed memory leaks in context2d #135

Merged
merged 1 commit into from
Dec 14, 2011
Merged

fixed memory leaks in context2d #135

merged 1 commit into from
Dec 14, 2011

Conversation

Tharit
Copy link
Contributor

@Tharit Tharit commented Dec 12, 2011

I found and fixed some memory leaks in the context2d implementation

1: The initial state and all states that were not popped by restore were not free'd
2: The path that is copied in savePath is not deleted after being appended back to the context in restorePath

@jimlears
Copy link

Would that happen to be this leak that Instruments is reporting? The code created a 500x500px canvas, getting its context and calling fillText() - that's all. Sucker leaks.

ss

@jimlears jimlears mentioned this pull request Dec 13, 2011
@Tharit
Copy link
Contributor Author

Tharit commented Dec 13, 2011

Yes, the leak in your screenshot is due the initial state (alloc'd in the constructor) not beeing freed.

@jimlears
Copy link

Patching the code with your fix and rebuilding canvas (seems to) work like a champ. That leak is gone.

@tj
Copy link
Contributor

tj commented Dec 14, 2011

Very weird I'm 99% sure we had this same patch 4 or 5 months ago! merging

tj added a commit that referenced this pull request Dec 14, 2011
fixed memory leaks in context2d
@tj tj merged commit 9821f2c into Automattic:master Dec 14, 2011
@tj
Copy link
Contributor

tj commented Dec 14, 2011

released 0.8.2

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.

3 participants