# from Gabor Szabo
# on Monday 09 March 2009 05:12:
>If I run it as it is it leaks about 20-30 bytes per run.
>If I enabled the event generation code as well which is currently
>commented out then with each run the RES memory will grow by ~ 600
> bytes.
> $file->Destroy( $e );
What if you also call $e->DESTROY here?
> Wx::Event::EVT_MENU(
> $main,
> $menu->Append( -1, $label ),
> sub {
> eval { $value->(@_) };
> },
> );
This is going to reference $label as long as the sub exists. I think
you might have to disconnect the event to free that memory.
On a completely different note: Why eval {} inside an event sub?
--Eric
--
"...the bourgeoisie were hated from both ends: by the proles, because
they had all the money, and by the intelligentsia, because of their
tendency to spend it on lawn ornaments."
--Neal Stephenson
---------------------------------------------------
http://scratchcomputing.com
---------------------------------------------------