[Vala] How to free delegate callbacks



Hi,

I have this big problem with memory consumption.

Gtk.Entry entry = new Gtk.Entry();
for (float i=0; i < 1000000; i++) {
    entry.focus_in_event.connect( () => {});
}
Gtk.main();


When I run the above code it uses about 40MB. Without the callback its
only 700KB.

Do you know what can I do to reduce the memory consumption?

Many thanks!
-- 
Adi Roiban




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