| Summary: | Use std::unique_ptr<>|std::make_unique_ptr in RenderThemeEfl::ThemePartCacheEntry::create() | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Gyuyoung Kim <gyuyoung.kim> | ||||||||||
| Component: | WebKit EFL | Assignee: | Gyuyoung Kim <gyuyoung.kim> | ||||||||||
| Status: | RESOLVED FIXED | ||||||||||||
| Severity: | Normal | CC: | commit-queue, fpizlo, lucas.de.marchi | ||||||||||
| Priority: | P2 | ||||||||||||
| Version: | 528+ (Nightly build) | ||||||||||||
| Hardware: | Unspecified | ||||||||||||
| OS: | Unspecified | ||||||||||||
| Bug Depends on: | |||||||||||||
| Bug Blocks: | 128007, 138652 | ||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Gyuyoung Kim
2014-11-09 23:24:00 PST
Created attachment 241279 [details]
Patch
Comment on attachment 241279 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=241279&action=review > Source/WebCore/platform/efl/RenderThemeEfl.cpp:246 > - ThemePartCacheEntry* entry = ThemePartCacheEntry::create(themePath(), type, size).leakPtr(); > + ThemePartCacheEntry* entry = ThemePartCacheEntry::create(themePath(), type, size).get(); get() isn't really the equivalent of get(). In particular, it seems that this will destroy ThemePartCacheEntry after this statement, leaving entry to be a dangling pointer. Can you look into this some more? (In reply to comment #2) > Comment on attachment 241279 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=241279&action=review > > > Source/WebCore/platform/efl/RenderThemeEfl.cpp:246 > > - ThemePartCacheEntry* entry = ThemePartCacheEntry::create(themePath(), type, size).leakPtr(); > > + ThemePartCacheEntry* entry = ThemePartCacheEntry::create(themePath(), type, size).get(); > > get() isn't really the equivalent of get(). Lol, meant to say: get() isn't really the equivalent of leakPtr(). > In particular, it seems that > this will destroy ThemePartCacheEntry after this statement, leaving entry to > be a dangling pointer. > > Can you look into this some more? (In reply to comment #2) > Comment on attachment 241279 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=241279&action=review > > > Source/WebCore/platform/efl/RenderThemeEfl.cpp:246 > > - ThemePartCacheEntry* entry = ThemePartCacheEntry::create(themePath(), type, size).leakPtr(); > > + ThemePartCacheEntry* entry = ThemePartCacheEntry::create(themePath(), type, size).get(); > > get() isn't really the equivalent of get(). In particular, it seems that > this will destroy ThemePartCacheEntry after this statement, leaving entry to > be a dangling pointer. > > Can you look into this some more? Ah, right. thank you for pointing it out. Let me fix it soon. Created attachment 241287 [details]
WIP
Created attachment 241337 [details]
Patch
Filip, latest patch fixes the leakPtr() removal. I removes original Eina_List with Vector<std::unique_ptr> because the Eina_List can't support std::unique_ptr. I wonder whether you can take a look this patch again. Comment on attachment 241337 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=241337&action=review > Source/WebCore/platform/efl/RenderThemeEfl.cpp:270 > + size_t cacheSize = m_partCache.size(); > + for (size_t i = 0; i < cacheSize; ++i) > + m_partCache[i].reset(); I think you should do something like for (auto& part : m_partCache) part = nullptr; here instead. Created attachment 241355 [details]
Patch for landing
Comment on attachment 241355 [details] Patch for landing Clearing flags on attachment: 241355 Committed r175953: <http://trac.webkit.org/changeset/175953> All reviewed patches have been landed. Closing bug. |