> Fltk expects that the windows you create are going to
> stay around until the last one is hidden. You can reclaim
> the memory used by the windows themselves safely enough, but
> the memory overhead of maintaining a continually growing list
> of (inactive) windows, though fairly small, will just continue
> to grow, I think.
I read your comments and Ian's and they make a lot of sense.
When the program exits (my own backdoor), it seems to recover all of the memory.
However, when it runs, it seem to use up more and more memory everytime a
window is created.
My way of creating windows may not be the most optimal from FLTK's point of
view but it seemed so obvious.
Maybe I will show an example and someone can point me to my wrong doing:
On a main window is a Fl_Menu_Bar with some Fl_Menu_Items.
In the Fl_Menu_Item callbacks I have:
callback {
About_Dialog *ad;
ad = new About_Dialog();
ad->show();
while (ad->visible()) Fl::wait();
delete ad;
}
where About_Dialog is a class with a Fl_Window AboutWindow + all regular stuff
in it (buttons, boxes, etc.) in a constructor.
It also contains show(), hide(), visible() and the destructor that calls:
Fl::delete_widget(AboutWindow);
I was trying to avoid creating all windows at once and reuse them like FLTK
expects you to do (?).
This would cause too much strain on my memory resources and I only need one
popup window at a time.
Does it make sense and how can I acomplish this without a leak?
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk