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

Conversation

Projects
None yet
3 participants
@Tharit
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@jimlears

jimlears Dec 13, 2011

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 commented Dec 13, 2011

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

@Tharit

This comment has been minimized.

Show comment
Hide comment
@Tharit

Tharit Dec 13, 2011

Contributor

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

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@jimlears

jimlears Dec 14, 2011

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

jimlears commented Dec 14, 2011

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

@tj

This comment has been minimized.

Show comment
Hide comment
@tj

tj Dec 14, 2011

Contributor

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

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

Merge pull request #135 from Tharit/master
fixed memory leaks in context2d

@tj tj merged commit 9821f2c into Automattic:master Dec 14, 2011

@tj

This comment has been minimized.

Show comment
Hide comment
@tj

tj Dec 14, 2011

Contributor

released 0.8.2

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