[GTK] WaylandCompositorDisplay leaks its wl_display
authormcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Apr 2018 07:14:15 +0000 (07:14 +0000)
committermcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Apr 2018 07:14:15 +0000 (07:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=184406

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Remove the protected default constructor, for good measure.

* platform/graphics/wayland/PlatformDisplayWayland.h:

Source/WebKit:

* WebProcess/gtk/WaylandCompositorDisplay.cpp:
(WebKit::WaylandCompositorDisplay::create): Fix a log message (drive-by).
(WebKit::WaylandCompositorDisplay::WaylandCompositorDisplay): Fix the leak.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230390 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/wayland/PlatformDisplayWayland.h
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/gtk/WaylandCompositorDisplay.cpp

index 4a67535..f7ab197 100644 (file)
@@ -1,3 +1,14 @@
+2018-04-09  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        [GTK] WaylandCompositorDisplay leaks its wl_display
+        https://bugs.webkit.org/show_bug.cgi?id=184406
+
+        Reviewed by Carlos Garcia Campos.
+
+        Remove the protected default constructor, for good measure.
+
+        * platform/graphics/wayland/PlatformDisplayWayland.h:
+
 2018-04-08  Fujii Hironori  <Hironori.Fujii@sony.com>
 
         [CMake] WebKit should link to WebCore as a PRIVATE library if WebCore is a static library
index e17dce0..d157687 100644 (file)
@@ -50,7 +50,6 @@ private:
     Type type() const override { return PlatformDisplay::Type::Wayland; }
 
 protected:
-    PlatformDisplayWayland() = default;
     void initialize(struct wl_display*);
 
     virtual void registryGlobal(const char* interface, uint32_t name);
index 2814372..e21564a 100644 (file)
@@ -1,3 +1,14 @@
+2018-04-09  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        [GTK] WaylandCompositorDisplay leaks its wl_display
+        https://bugs.webkit.org/show_bug.cgi?id=184406
+
+        Reviewed by Carlos Garcia Campos.
+
+        * WebProcess/gtk/WaylandCompositorDisplay.cpp:
+        (WebKit::WaylandCompositorDisplay::create): Fix a log message (drive-by).
+        (WebKit::WaylandCompositorDisplay::WaylandCompositorDisplay): Fix the leak.
+
 2018-04-08  Zan Dobersek  <zdobersek@igalia.com>
 
         Non-Cocoa ports use default directory for ServiceWorker data during testing
index 17735b1..2f64f4d 100644 (file)
@@ -44,7 +44,7 @@ std::unique_ptr<WaylandCompositorDisplay> WaylandCompositorDisplay::create(const
 
     struct wl_display* display = wl_display_connect(displayName.utf8().data());
     if (!display) {
-        WTFLogAlways("PlatformDisplayWayland initialization: failed to connect to the Wayland display: %s", displayName.utf8().data());
+        WTFLogAlways("WaylandCompositorDisplay initialization: failed to connect to the Wayland display: %s", displayName.utf8().data());
         return nullptr;
     }
 
@@ -61,8 +61,8 @@ void WaylandCompositorDisplay::bindSurfaceToPage(struct wl_surface* surface, Web
 }
 
 WaylandCompositorDisplay::WaylandCompositorDisplay(struct wl_display* display)
+    : PlatformDisplayWayland(display, NativeDisplayOwned::Yes)
 {
-    initialize(display);
     PlatformDisplay::setSharedDisplayForCompositing(*this);
 }