I'm using Mono + GTK# + Cairo + Pango on Ubuntu 12.04 and I found some memory leaks when using a Pango.Layout
object.
I'm drawing some animation with a framerate of about 30 fps and my memory only increases. I remove a lot of code and here is what remains:
void OnDraw(DrawingArea area)
{
Cairo.Context context = Gdk.CairoHelper.Create(area.GdkWindow);
using (var lay = Pango.CairoHelper.CreateLayout(context))
{
// Nothing.
}
((IDisposable) context.Target).Dispose();
((IDisposable) context).Dispose();
}
Without the Pango.CairoHelper.CreateLayout
call the memory remains stable, but with it increases for about 10k per second which is clearly unacceptable.
Is there something I'm doing wrong? Is Mono + GTK# + Cairo + Pango ready for production?
Mono version : 2.10.8.1-1ubuntu2.2
GTK# version : 2.12.10-2ubuntu4
Pango version : 1.30.0-0ubuntu3.1
uname : Linux ######-VirtualBox 3.2.0-29-generic-pae #46-Ubuntu SMP Fri Jul 27 17:25:43 UTC 2012 i686 i686 i386 GNU/Linux