After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 747295 - shared memory leak when creating/destroying widgets
shared memory leak when creating/destroying widgets
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
3.14.x
Other Linux
: Normal major
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-04-03 10:39 UTC by Aurele
Modified: 2015-11-24 19:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test program (2.20 KB, text/plain)
2015-04-03 10:39 UTC, Aurele
  Details
wayland: Plug surface leak (1.73 KB, patch)
2015-11-24 19:43 UTC, Carlos Garnacho
committed Details | Review

Description Aurele 2015-04-03 10:39:37 UTC
Created attachment 300879 [details]
test program

Hello

I' using gtk+-3.14.11 with wayland-1.6 (tried 1.6.1), builded with yocto 1.7.
With the attached programm when I'm destroying the window the memory is not released. Only shared memory grows up, on the program and "weston", after some run the programm is killed.
test is compiled with :
"gcc `pkg-config --cflags gtk+-3.0` -o example-1 example-1.c `pkg-config --libs gtk+-3.0`"

thanks for any answer
Aurèle
Comment 1 Carlos Garnacho 2015-11-24 19:43:10 UTC
Created attachment 316197 [details] [review]
wayland: Plug surface leak

Other backends take care of the cairo surface destruction in
GdkWindow::destroy. We must do the same here, or the cairo_surface
and its corresponding wl_buffer are left dangling.
Comment 2 Matthias Clasen 2015-11-24 19:50:17 UTC
Review of attachment 316197 [details] [review]:

::: gdk/wayland/gdkdisplay-wayland.c
@@ +1031,3 @@
 
+  g_print ("EHMMMM...\n");
+

just remove these leftovers.

::: gdk/wayland/gdkwindow-wayland.c
@@ +1774,3 @@
+      cairo_surface_destroy (impl->cairo_surface);
+      impl->cairo_surface = NULL;
+    }

nice catch
Comment 3 Carlos Garnacho 2015-11-24 19:55:42 UTC
Just noticed that I accidentally pushed the untouched patch :(... fixing up immediately.

Attachment 316197 [details] pushed as d62febc - wayland: Plug surface leak