[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

pango get_x_ranges memory leak



While looking at something else ... I suspect the array from
pango_layout_line_get_x_ranges() has to be freed.  Memory use
in foo.pl below grows and grows.

use strict;
use warnings;
use Gtk2 '-init';

my $toplevel = Gtk2::Window->new('toplevel');
my $layout = $toplevel->create_pango_layout ("hello\nworld");
my $line = $layout->get_line (0);

for (;;) {
  $line->get_x_ranges (0, 1);
}


--- PangoLayout.xs	27 Mar 2008 10:20:30 +1100	1.39
+++ PangoLayout.xs	19 Aug 2008 17:12:12 +1000	
@@ -563,6 +563,7 @@
 		av_push (av, newSViv (ranges[i + 1]));
 		PUSHs (sv_2mortal (newRV_noinc ((SV *) av)));
 	}
+	g_free (ranges);
 
 
 ####  void pango_layout_line_get_extents (PangoLayoutLine *line, PangoRectangle *ink_rect, PangoRectangle *logical_rect)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]