in reply to Re^2: what is difference between calling the function in Perl/Tk in the following ways
in thread what is difference between calling the function in Perl/Tk in the following ways

Both these two would leak, I fear. The only safe way is to call
-command=>[\&function,\$arg1,\$arg2]
  • Comment on Re^3: what is difference between calling the function in Perl/Tk in the following ways
  • Download Code

Replies are listed 'Best First'.
Re^4: what is difference between calling the function in Perl/Tk in the following ways
by ikegami (Patriarch) on Apr 16, 2010 at 15:16 UTC

    By adding \$arg1,\$arg2, the memory leak goes away? I don't think so.

      Not only by adding the references, but also by including them into a list instead of using them directly. We tested it hundred times, really.
        That would be awesome, except you seem to have forgotten to post the test.