Re: [Vala] How to free delegate callbacks
- From: Yu Feng <rainwoodman gmail com>
- To: Adi Roiban <adi roiban ro>
- Cc: vala-list <vala-list gnome org>
- Subject: Re: [Vala] How to free delegate callbacks
- Date: Sun, 24 May 2009 22:21:54 -0400
On Mon, 2009-05-25 at 00:53 +0300, Adi Roiban wrote:
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.
The only way I know to disconnect a signal handler is to explicitly
assign it a name first. eg, declare the handler as a member function,
then feed the function name to signal.disconnect.
Yu
Do you know what can I do to reduce the memory consumption?
Many thanks!
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]