[Gtk-sharp-list] Memory leak on Windows

Jim Norman jnorman at novell.com
Wed May 2 18:05:22 EDT 2007


This code appears to produce a memory leak on windows, but not on linux.
What gives?
 
Thanks in advance.
Jim
 
using System;
using System.Text;
using Gtk;
 
namespace Test
{
    class Test
    {
 
        static void Main(string[] args)
        {
            
            Gtk.TreeStore ts = new TreeStore(typeof(string), typeof(string[]));
            Gtk.TreeView tv = new TreeView();
            tv.Model = ts;
 
            while (true)
            {
                string temp = "Name";
                string[] saArray = new string[2];
                saArray[0] = "first";
                saArray[1] = "last";
                ts.AppendValues(temp, saArray);
                //ts.AppendValues(temp);
 
                long memalloc = GC.GetTotalMemory(true);
                Console.WriteLine("Memory usage: {0}", memalloc.ToString());
                Console.WriteLine();
                Console.WriteLine("press enter to continue");
                Console.ReadLine();
 
                
                ts.Clear();
 
            }
        }
    }
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20070502/af351ef9/attachment.html 


More information about the Gtk-sharp-list mailing list