Fix the leaking ImageBuffer buffers on TOT
I can't test this due to the ASSERT SVGImage/Loader regression on TOT. Someone else should land this as I'm about to get on a plane.
Created attachment 12190 [details]
ccing WildFox. I figure he might be curious about the leak.
Comment on attachment 12190 [details]
The SVGAnimateTransformElement.cpp change seems good, but unrelated.
I'd prefer to keep to a minimum the number of new functions that return an object that you're obliged to delete. A good way to indicate that is to use auto_ptr<X> instead of X*. That's not so common because normally we use Shared and RefPtr. Perhaps ImageBuffer should be Shared and then we could return a PassRefPtr.
No need to do the if statements in ~ImageBuffer. Both CGImageRelease and fastFree already do checks for null.
The private constructor that takes ownership of a GraphicsContext should take an auto_ptr<GraphicsContext> parameter to indicate it takes ownership.
Also, I'd suggest that the declaration of the private constructor not be CG_specific, even if the implementation has to be.
OwnPtr is to auto_ptr as RefPtr is to PassRefPtr.
It would be best if someone else landed this (applying darin's suggestions if they so desire).
Committed revision 18641.