Summary: | CoordinatedGraphicsScene: properly limit data specific to state commit operation | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Zan Dobersek <zan> | ||||
Component: | New Bugs | Assignee: | Zan Dobersek <zan> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | bugs-noreply, svillar, webkit-bug-importer | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | WebKit Nightly Build | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Zan Dobersek
2018-03-05 02:41:13 PST
Created attachment 334993 [details]
Patch
Comment on attachment 334993 [details]
Patch
Why not using a RAII approach? CommitScope could be a class and the cleanups could be done in the destructor which would be called once the variable gets out of scope.
(In reply to Sergio Villar Senin from comment #2) > Comment on attachment 334993 [details] > Patch > > Why not using a RAII approach? CommitScope could be a class and the cleanups > could be done in the destructor which would be called once the variable gets > out of scope. Structs are same as classes, just the default member accessibility is public. As such, the default destructor ivokes destructors of both containers, effectively cleaning up every object that's been stored there during the state commit op. Comment on attachment 334993 [details] Patch Clearing flags on attachment: 334993 Committed r229315: <https://trac.webkit.org/changeset/229315> All reviewed patches have been landed. Closing bug. (In reply to Zan Dobersek from comment #3) > (In reply to Sergio Villar Senin from comment #2) > > Comment on attachment 334993 [details] > > Patch > > > > Why not using a RAII approach? CommitScope could be a class and the cleanups > > could be done in the destructor which would be called once the variable gets > > out of scope. > > Structs are same as classes, just the default member accessibility is public. > > As such, the default destructor ivokes destructors of both containers, > effectively cleaning up every object that's been stored there during the > state commit op. Not sure if you're getting my point, what I wanted is to get rid of the explicit .clear() (In reply to Sergio Villar Senin from comment #7) > (In reply to Zan Dobersek from comment #3) > > (In reply to Sergio Villar Senin from comment #2) > > > Comment on attachment 334993 [details] > > > Patch > > > > > > Why not using a RAII approach? CommitScope could be a class and the cleanups > > > could be done in the destructor which would be called once the variable gets > > > out of scope. > > > > Structs are same as classes, just the default member accessibility is public. > > > > As such, the default destructor ivokes destructors of both containers, > > effectively cleaning up every object that's been stored there during the > > state commit op. > > Not sure if you're getting my point, what I wanted is to get rid of the > explicit .clear() Right, it's not necessary for those to be explicitly called, I'll remove them. |