Commit de568c1
Image should clear its ImageObserver* when CachedImage releases the last reference to its RefCounted<ImageObserver>
https://bugs.webkit.org/show_bug.cgi?id=173077
Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-06-09
Reviewed by Simon Fraser.
Before dereferencing ImageObserver, CachedImage::clearImage() should check
whether it is the only object that holds a reference to this ImageObserver.
And if this is true, m_image have to clear its raw pointer to the deleted
ImageObserver by calling m_image->setImageObserver(nullptr).
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::setBodyDataFrom):
(WebCore::CachedImage::CachedImageObserver::CachedImageObserver):
(WebCore::CachedImage::clearImage):
* loader/cache/CachedImage.h:
Canonical link: https://commits.webkit.org/190050@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218038 268f45cc-cd09-0410-ab3c-d52691b4dbfc1 parent 8e38c07 commit de568c1Copy full SHA for de568c1
3 files changed
+35-8Lines changed: 35 additions & 8 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- Source/WebCore
- loader/cache
Expand file treeCollapse file tree
Open diff view settings
Collapse file
+18Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
1 | 19 | |
2 | 20 | |
3 | 21 | |
|
Collapse file
Source/WebCore/loader/cache/CachedImage.cpp
Copy file name to clipboardExpand all lines: Source/WebCore/loader/cache/CachedImage.cpp+13-4Lines changed: 13 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
101 | 101 | |
102 | 102 | |
103 | 103 | |
104 | | - |
| 104 | + |
105 | 105 | |
106 | 106 | |
107 | 107 | |
| ||
326 | 326 | |
327 | 327 | |
328 | 328 | |
329 | | - |
330 | | - |
| 329 | + |
331 | 330 | |
332 | 331 | |
333 | 332 | |
| ||
367 | 366 | |
368 | 367 | |
369 | 368 | |
| 369 | + |
| 370 | + |
| 371 | + |
370 | 372 | |
371 | | - |
| 373 | + |
| 374 | + |
| 375 | + |
| 376 | + |
| 377 | + |
| 378 | + |
| 379 | + |
372 | 380 | |
373 | 381 | |
| 382 | + |
374 | 383 | |
375 | 384 | |
376 | 385 | |
|
Collapse file
Source/WebCore/loader/cache/CachedImage.h
Copy file name to clipboardExpand all lines: Source/WebCore/loader/cache/CachedImage.h+4-4Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
120 | 120 | |
121 | 121 | |
122 | 122 | |
123 | | - |
124 | | - |
| 123 | + |
| 124 | + |
125 | 125 | |
126 | 126 | |
127 | 127 | |
128 | 128 | |
129 | 129 | |
130 | | - |
| 130 | + |
131 | 131 | |
132 | 132 | |
133 | 133 | |
134 | 134 | |
135 | 135 | |
136 | 136 | |
137 | 137 | |
138 | | - |
| 138 | + |
139 | 139 | |
140 | 140 | |
141 | 141 | |
|
0 commit comments