GNOME Bugzilla – Bug 586491
Memory leak in Buffer.Data
Last modified: 2009-09-11 08:53:41 UTC
Somehow the buffer still manages to lose its data.
Created attachment 137090 [details] [review] Adds example to show the memory leak This patch adds an example program to the samples. The program sends buffers to an appsrc. Besides a good showcase of how to use buffer/appsrc, it also shows the memory leakage.
Fortunately, it turned out the memory leak wasn't in gstreamer-sharp. It is in Mono.Cairo or the sample app, however you want to see it. The Cairo.Surface needs to be explicitly destroyed. On top of the previouse patch, apply: - return img.Data; + byte[] data = img.Data; + img.Destroy(); + return data; The testcase now runs smoothly, without eating up all your GBs of ram. Please do add the corrected sample to the git tree, as it is a nice sample app.