in reply to TK::ProgressBar and update memory build up
Commenting out the last line (#$mw->update();) I found that the program runs as before (update is not needed) and there is no more memory leak.
The strange thing is that the same effect (no leak) can be obtained commenting out the $percent=rand(100); line instead of the update line.
In this last version I occasionally get this message in console:
Tk::Error: Usage $widget->update(...) MainWindow=HASH(0x8286464) is not a Tk object at ./x.pl line 28. Tk callback for .button <ButtonRelease-1> (command bound to event)
IMHO this seems to imply that the update method is not fully reentrant and so repeated calls to it may cause a problem. I don't know if this can be related to the memory leak problem that looks like a var reference not correctly freed...
Rule One: "Do not act incautiously when confronting a little bald wrinkly smiling man."
|
|---|