![]() |
|
Keep It Simple, Stupid | |
PerlMonks |
Re: threads and leaking scalars (Scalars leaked: 1)by dpmott (Scribe) |
on Feb 26, 2004 at 18:09 UTC ( #332064=note: print w/replies, xml ) | Need Help?? |
I had this very same problem, and I finally figured it out.
If you change this line (in new()): To this: then it will work. I suspect that there's too much magic associated with the @_ variable to let threads play nicely with it. So, my recommendation is to *not* use @_ in the same scope as you launch new threads. Update: Unfortunately, including other modules (say, XML::DOM) may cause this same problem, so you'd have to launch all of your threads before bringing in such modules. This might be a good use for Thread::Pool...
In Section
Seekers of Perl Wisdom
|
|