mkajdas.mkprod wrote:
> After fixing (a workaround) another leak (see my "Fl_Help_View memory leak"
> post) I am still experiencing an unexplained heap memory usage.
> Basically, anytime I create a window and then delete it, about 1-2 kB of
> memory is never released and is accumulates every time I create the same or
> another window.
>
> My program has many segments like this:
>
> win = new window(...);
> win->show();
> ..
> win->hide();
> delete win;
Actually, you're not supposed to delete FLTK widgets with C++ delete,
FLTK must handle the deletion to ensure the widget(s) are properly
disconnected from the widget tree correctly.
I believe what you want is Fl::delete_widget() which will schedule
the deletion when you return to the application loop.
http://fltk.org/documentation.php/doc-1.1/Fl.html#Fl.delete_widget
There should probably be a special section in the docs about
deleting widgets (if there isn't already one), as this seems to
come up a lot on the newsgroup.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk