On 2013-07-18 06:56, Justin Lazear wrote:> Hi Michiel,
 >
 > On my system, deleting the timer has no effect and the timer continues
 > to send events. The __del__ method seems to call the same unimplemented
 > _timer_stop method. Regardless, something else has a reference to the
 > timer (MPL event loop maybe?) and __del__ is not being called once the
 > timer has been started. It's not clear to me what should be 
stopping the
 > timer in that case.
 >
 > Does del t stop the timer on your system? If so, could we hunt down 
what
 > is happening after you delete the name t that is causing the timer 
to stop?
 >
 > I would personally prefer an explicit .stop() method, since I would
 > prefer not to rely on the garbage collector's behavior being consistent
 > (hard to make sure nothing else is holding a reference to timer) when
 > there is a very well-defined function that does what I want.

        Relying on "del t" can't be the right solution, since like you note, 
it only deletes the name, not the object.  If you create multiple 
references to a timer and only del some of them, e.g.:

t = fig.canvas.new_timer()
x = t
del t

Then the object's __del__ will definitely not be called yet.  It makes 
sense to have a way to stop the timer directly, regardless of how many 
names are pointing to it.

-- 
Brendan Barnwell
"Do not follow where the path may lead.  Go, instead, where there is 
no path, and leave a trail."
    --author unknown

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to