[WPE][GTK] WaylandCompositor fails to properly remove surface from its page map
authormcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Aug 2018 15:17:55 +0000 (15:17 +0000)
committermcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Aug 2018 15:17:55 +0000 (15:17 +0000)
commita61144726d20699524ac797fd9df71819171aba8
treec88b2f71c4bcbb99af779c4de3bcfc0aaa10deac
parentffd8c7f1884e999ed3e516230dc21633b9c67105
[WPE][GTK] WaylandCompositor fails to properly remove surface from its page map
https://bugs.webkit.org/show_bug.cgi?id=188520

Reviewed by Alex Christensen.

Source/WebKit:

willDestroySurface overwrites the surface pointer in the map's iterator in an attempt to
change the value of the surface pointer in the map, but it doesn't work because changing
the iterator does not change the map itself. There's no need to fix this function: it's
better to use WeakPtr instead.

* UIProcess/gtk/WaylandCompositor.cpp:
(WebKit::WaylandCompositor::getTexture):
(WebKit::WaylandCompositor::bindSurfaceToWebPage):
(WebKit::WaylandCompositor::unregisterWebPage):
(WebKit::WaylandCompositor::willDestroySurface): Deleted.
* UIProcess/gtk/WaylandCompositor.h:

Source/WTF:

Add a comment pointing to CanMakeWeakPtr, since it's useful and I very nearly missed it.

* wtf/WeakPtr.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234887 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WTF/ChangeLog
Source/WTF/wtf/WeakPtr.h
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/gtk/WaylandCompositor.cpp
Source/WebKit/UIProcess/gtk/WaylandCompositor.h