|
Bugzilla – Full Text Bug Listing |
| Summary: | GLib.Timeout leaks memory | ||
|---|---|---|---|
| Product: | [Mono] gtk# | Reporter: | Mike Krueger <mkrueger> |
| Component: | gtk-sharp | Assignee: | Gtk# Bugs List <gtk-sharp-bugs> |
| Status: | RESOLVED DUPLICATE | QA Contact: | Gtk# Bugs List <gtk-sharp-bugs> |
| Severity: | Major | ||
| Priority: | P5 - None | ||
| Version: | 2.x | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | openSUSE 11.2 | ||
| Whiteboard: | |||
| Found By: | --- | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
The first testcase leaks under 2.6.4 and also mono r156824. The second testcase leaks under neither. Possibly related to bug #605295 Yes it's the same. *** This bug has been marked as a duplicate of bug 605295 *** |
This program leaks memory: class Test { static bool Timeout() { Console.WriteLine ("TIMEOUT "); return false; } static GLib.TimeoutHandler handler = Timeout; public static void Main (string[] args) { Gtk.Application.Init (); do { uint timer = GLib.Timeout.Add (650, handler); GLib.Source.Remove (timer); System.GC.Collect (); } while (true); } } This one doesn't: class Test { static bool Timeout() { Console.WriteLine ("TIMEOUT "); return false; } static GLib.TimeoutHandler handler = Timeout; public static void Main (string[] args) { Gtk.Application.Init (); do { uint timer = GlibTimer.Add (650, handler); GlibTimer.Remove (timer); System.GC.Collect (); } while (true); } class GlibTimer { public delegate bool TimeoutHandler (); public static uint Add (uint timeOut, TimeoutHandler handler) { return g_timeout_add (timeOut, handler, IntPtr.Zero); } public static void Remove (uint id) { g_source_remove (id); } [DllImport("libglib-2.0.so")] static extern void g_source_remove (uint id); [DllImport("libglib-2.0.so")] static extern uint g_timeout_add (uint id, TimeoutHandler function, IntPtr data); } }