|
|
Created:
12 years, 1 month ago by Leon Modified:
10 years, 10 months ago CC:
skia-review_googlegroups.com Base URL:
https://skia.googlecode.com/svn/trunk Visibility:
Public. |
DescriptionWhen cloning into an SkPicture, clear its data.
Prevents a memory leak if the caller clones into an SkPicture
that already has a playback or record.
Committed: https://code.google.com/p/skia/source/detail?r=6282
Patch Set 1 #
MessagesTotal messages: 13
On 2012/11/02 20:36:35, scroggo-work wrote: reed@ gave me verbal approval, but wondered if it would make more sense to have clone() return new SkPictures (rather than requiring the caller to create them, which gives them the opportunity to run into this problem).
Sign in to reply to this message.
lgtm. Mike and I decided to have the caller pass in the SkPicture so that they could be created on the stack, but I would be open to revisiting the decision.
Sign in to reply to this message.
I like having the Array be on the stack (rather than the API returning a SkTDArray), but I do favor having the API create new pictures to stuff into the array.
Sign in to reply to this message.
Is there a bleeding-edge canary that will have this build available somewhere? On Mon, Nov 5, 2012 at 8:31 AM, <reed@google.com> wrote: > I like having the Array be on the stack (rather than the API returning a > SkTDArray), but I do favor having the API create new pictures to stuff > into the array. > > https://codereview.appspot.**com/6813081/<https://codereview.appspot.com/6813... >
Sign in to reply to this message.
oops, wrong thread. On Mon, Nov 5, 2012 at 8:44 AM, Mike Reed <reed@google.com> wrote: > Is there a bleeding-edge canary that will have this build available > somewhere? > > > On Mon, Nov 5, 2012 at 8:31 AM, <reed@google.com> wrote: > >> I like having the Array be on the stack (rather than the API returning a >> SkTDArray), but I do favor having the API create new pictures to stuff >> into the array. >> >> https://codereview.appspot.**com/6813081/<https://codereview.appspot.com/6813... >> > >
Sign in to reply to this message.
On 2012/11/05 13:19:34, DerekS wrote: > lgtm. > > Mike and I decided to have the caller pass in the SkPicture so that they could > be created on the stack, but I would be open to revisiting the decision. Yeah, that makes sense to me. Thinking about it over the weekend, it occurred to me that SkBitmap follows a similar pattern. SkBitmap::copyTo (and ::deepCopyTo) allow the caller to allocate the SkBitmap how they wish and then copy into it.
Sign in to reply to this message.
Message was sent while issue was closed.
15 months later, everybody in London is confused by this change: the previous line of code sets clone->fRecord = NULL, and then the first line of this change checks to see if it's non-NULL. Do we need a followup?
Sign in to reply to this message.
Message was sent while issue was closed.
Seems to me that I may have rubber stamped LGTM'd this one without doing a full review. I think we just need to remove line 158 for this CL to make sense, but I'll let Leon confirm.
Sign in to reply to this message.
Message was sent while issue was closed.
On 2014/02/14 12:27:07, TomH wrote: > 15 months later, everybody in London is confused by this change: the previous > line of code sets clone->fRecord = NULL, and then the first line of this change > checks to see if it's non-NULL. Do we need a followup? Ha! Count me among the confused too. Clearly this is just a fancy way to say SkDELETE(clone->fPlayback);.
Sign in to reply to this message.
Message was sent while issue was closed.
On 2014/02/14 14:51:01, mtklein wrote: > On 2014/02/14 12:27:07, TomH wrote: > > 15 months later, everybody in London is confused by this change: the previous > > line of code sets clone->fRecord = NULL, and then the first line of this > change > > checks to see if it's non-NULL. Do we need a followup? > > Ha! Count me among the confused too. Clearly this is just a fancy way to say > SkDELETE(clone->fPlayback);. My suggested fix was this https://codereview.chromium.org/163053005/
Sign in to reply to this message.
Message was sent while issue was closed.
On 2014/02/14 14:50:51, DerekS wrote: > Seems to me that I may have rubber stamped LGTM'd this one without doing a full > review. I think we just need to remove line 158 for this CL to make sense, but > I'll let Leon confirm. Yep. I'll let this be a reminder to write tests. Deleting the fPlayback fixed the memory leak I happened to run into, and the other code was copied from beginRecording.
Sign in to reply to this message.
|