Bug 20532 - Memory leaks when animating transforms
Summary: Memory leaks when animating transforms
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh OS X 10.5
: P2 Normal
Assignee: Chris Marrin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-26 17:25 PDT by Chris Marrin
Modified: 2008-08-27 16:27 PDT (History)
2 users (show)

See Also:


Attachments
testcase showing memory leak (861 bytes, text/html)
2008-08-26 17:30 PDT, Chris Marrin
no flags Details
Patch to fix bug (9.02 KB, patch)
2008-08-27 11:43 PDT, Chris Marrin
hyatt: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Marrin 2008-08-26 17:25:09 PDT
All the subclasses of TransformOperation::blend() return objects that have been created using new. This object is never deleted, so always leaks. Attached is a simple test case which shows the problem. Run it, then close the Safari window, run leaks on the Safari process and you will see the leaks in WebCore::RotateTransformOperation.

Note, there's also a leak in NSCFString, but that's unrelated.
Comment 1 Chris Marrin 2008-08-26 17:30:52 PDT
Created attachment 23009 [details]
testcase showing memory leak
Comment 2 Chris Marrin 2008-08-27 11:43:19 PDT
Created attachment 23033 [details]
Patch to fix bug
Comment 3 Eric Seidel (no email) 2008-08-27 15:37:37 PDT
Comment on attachment 23033 [details]
Patch to fix bug

Seems the associated constructors should be made private to prevent this in the future.
Comment 4 Simon Fraser (smfr) 2008-08-27 15:48:38 PDT
Eric: they are private already, e.g.
http://trac.webkit.org/browser/trunk/WebCore/rendering/style/RenderStyle.h#L843

The code was calling 'new' from inside transform operations methods, so a constructor call was allowed.
Comment 5 Dave Hyatt 2008-08-27 15:51:07 PDT
Comment on attachment 23033 [details]
Patch to fix bug

r=me
Comment 6 Simon Fraser (smfr) 2008-08-27 16:16:58 PDT
Committed r35952
	M	WebCore/rendering/style/RenderStyle.cpp
	M	WebCore/rendering/style/RenderStyle.h
	M	WebCore/ChangeLog
r35952 = 7dbde25cd3b95eb1b340a2ff7b86104d057e8ed2 (trunk)
Comment 7 Simon Fraser (smfr) 2008-08-27 16:17:05 PDT
Committed r35952
	M	WebCore/rendering/style/RenderStyle.cpp
	M	WebCore/rendering/style/RenderStyle.h
	M	WebCore/ChangeLog
r35952 = 7dbde25cd3b95eb1b340a2ff7b86104d057e8ed2 (trunk)
Comment 8 Eric Seidel (no email) 2008-08-27 16:27:10 PDT
Ah, my bad.