wayland: Don't leak all surfaces
authorBenjamin Otte <otte@redhat.com>
Sun, 16 Apr 2023 02:39:21 +0000 (04:39 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 16 Apr 2023 17:28:21 +0000 (19:28 +0200)
X11 does add an extra reference to surfaces that gets released when the
DestroyNotify event arrives.
Wayland doesn't ave such an event, so that reference never gets
released.

This fixes a copy/paste error introduced in commit 590f3dfa1fcb.

gdk/wayland/gdksurface-wayland.c

index 0389822f80fa6b8ea5ecd5f8a6737a4aec3675ba..4ead1d29aaa202310b0a1d72c9443450dd164e1d 100644 (file)
@@ -896,8 +896,6 @@ _gdk_wayland_display_create_surface (GdkDisplay     *display,
   surface->width = width;
   surface->height = height;
 
-  g_object_ref (surface);
-
   /* More likely to be right than just assuming 1 */
   if (wl_compositor_get_version (display_wayland->compositor) >= WL_SURFACE_SET_BUFFER_SCALE_SINCE_VERSION)
     {