Title: [184374] trunk/Source/WebCore
Revision
184374
Author
[email protected]
Date
2015-05-15 00:05:47 -0700 (Fri, 15 May 2015)

Log Message

[GTK] Fix PlatformDisplayWayland construction error, implement the destructor
https://bugs.webkit.org/show_bug.cgi?id=144997

Reviewed by Carlos Garcia Campos.

The PlatformDisplayWayland constructor is private, so we can't use
std::make_unique<>() to construct an object of this class.

Implement the PlatformDisplayWayland destructor, cleaning out all
the Wayland resources, if present.

* platform/graphics/wayland/PlatformDisplayWayland.cpp:
(WebCore::PlatformDisplayWayland::create):
(WebCore::PlatformDisplayWayland::PlatformDisplayWayland):
(WebCore::PlatformDisplayWayland::~PlatformDisplayWayland):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (184373 => 184374)


--- trunk/Source/WebCore/ChangeLog	2015-05-15 05:09:46 UTC (rev 184373)
+++ trunk/Source/WebCore/ChangeLog	2015-05-15 07:05:47 UTC (rev 184374)
@@ -1,3 +1,21 @@
+2015-05-15  Zan Dobersek  <[email protected]>
+
+        [GTK] Fix PlatformDisplayWayland construction error, implement the destructor
+        https://bugs.webkit.org/show_bug.cgi?id=144997
+
+        Reviewed by Carlos Garcia Campos.
+
+        The PlatformDisplayWayland constructor is private, so we can't use
+        std::make_unique<>() to construct an object of this class.
+
+        Implement the PlatformDisplayWayland destructor, cleaning out all
+        the Wayland resources, if present.
+
+        * platform/graphics/wayland/PlatformDisplayWayland.cpp:
+        (WebCore::PlatformDisplayWayland::create):
+        (WebCore::PlatformDisplayWayland::PlatformDisplayWayland):
+        (WebCore::PlatformDisplayWayland::~PlatformDisplayWayland):
+
 2015-05-14  Zalan Bujtas  <[email protected]>
 
         Images on www.fitstylelife.com jiggle on hover.

Modified: trunk/Source/WebCore/platform/graphics/wayland/PlatformDisplayWayland.cpp (184373 => 184374)


--- trunk/Source/WebCore/platform/graphics/wayland/PlatformDisplayWayland.cpp	2015-05-15 05:09:46 UTC (rev 184373)
+++ trunk/Source/WebCore/platform/graphics/wayland/PlatformDisplayWayland.cpp	2015-05-15 07:05:47 UTC (rev 184374)
@@ -61,11 +61,11 @@
     if (!wlDisplay)
         return nullptr;
 
-    auto display = std::make_unique<PlatformDisplayWayland>(wlDisplay);
+    auto display = std::unique_ptr<PlatformDisplayWayland>(new PlatformDisplayWayland(wlDisplay));
     if (!display->isInitialized())
         return nullptr;
 
-    return WTF::move(display);
+    return display;
 }
 
 PlatformDisplayWayland::PlatformDisplayWayland(struct wl_display* wlDisplay)
@@ -100,6 +100,18 @@
     m_eglConfigChosen = true;
 }
 
+PlatformDisplayWayland::~PlatformDisplayWayland()
+{
+    if (m_webkitgtk)
+        wl_webkitgtk_destroy(m_webkitgtk);
+    if (m_compositor)
+        wl_compositor_destroy(m_compositor);
+    if (m_registry)
+        wl_registry_destroy(m_registry);
+    if (m_display)
+        wl_display_disconnect(m_display);
+}
+
 std::unique_ptr<WaylandSurface> PlatformDisplayWayland::createSurface(const IntSize& size, int widgetId)
 {
     struct wl_surface* wlSurface = wl_compositor_create_surface(m_compositor);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to