Last Comment Bug 711355 - memory management errors in nsCoreAnimationSupport.mm
: memory management errors in nsCoreAnimationSupport.mm
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Graphics (show other bugs)
: Trunk
: x86 Mac OS X
: -- normal (vote)
: mozilla12
Assigned To: Jonathan Kew (:jfkthame)
:
: Milan Sreckovic [:milan]
Mentors:
Depends on:
Blocks: clang-based-analysis 711301
  Show dependency treegraph
 
Reported: 2011-12-16 02:02 PST by Jonathan Kew (:jfkthame)
Modified: 2012-01-10 18:55 PST (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
fix potential leaks found by static analysis (4.79 KB, patch)
2011-12-16 02:02 PST, Jonathan Kew (:jfkthame)
b56girard: review+
Details | Diff | Splinter Review

Description Jonathan Kew (:jfkthame) 2011-12-16 02:02:48 PST
Created attachment 582212 [details] [diff] [review]
fix potential leaks found by static analysis

Potential leaks noted in the static analysis reports:
http://people.mozilla.org/~gszorc/clang/2011-12-15-13/report-74UjgP.html#EndPath
http://people.mozilla.org/~gszorc/clang/2011-12-15-13/report-7ompG0.html#EndPath
http://people.mozilla.org/~gszorc/clang/2011-12-15-13/report-dhueRI.html#EndPath
http://people.mozilla.org/~gszorc/clang/2011-12-15-13/report-eKkcGp.html#EndPath
http://people.mozilla.org/~gszorc/clang/2011-12-15-13/report-WQpx10.html#EndPath

Most of these are in a DEBUG-only diagnostic function, so wouldn't affect normal users, but we should still tidy them up.

I've also removed a couple of redundant NULL-checks that I noticed in passing - the CG*Release APIs are documented as NULL-safe.
Comment 1 Benoit Girard (:BenWa) 2012-01-09 10:17:28 PST
Comment on attachment 582212 [details] [diff] [review]
fix potential leaks found by static analysis

Sorry I missed the review email and saw this today! These are all good changes. I'm not a fan of removing the null check before release even if the API allows it because it will cause others to wonder and have to check the documentation.
Comment 2 Jonathan Kew (:jfkthame) 2012-01-10 06:50:37 PST
(In reply to Benoit Girard (:BenWa) from comment #1)
> I'm not a fan of removing the null check before release even if the
> API allows it because it will cause others to wonder and have to check the
> documentation.
OK, I removed these two extra chunks from the patch prior to pushing it.

https://hg.mozilla.org/integration/mozilla-inbound/rev/d58132b4ecc4
Comment 3 Ed Morley [:emorley] 2012-01-10 18:55:08 PST
https://hg.mozilla.org/mozilla-central/rev/d58132b4ecc4

Note You need to log in before you can comment on or make changes to this bug.