|
From: <ry...@us...> - 2010-09-11 19:03:58
|
Revision: 8697
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8697&view=rev
Author: ryanmay
Date: 2010-09-11 19:03:52 +0000 (Sat, 11 Sep 2010)
Log Message:
-----------
Handle multple calls to GTKTimer.start() by stopping any existing gtk timer id.
Modified Paths:
--------------
branches/v1_0_maint/lib/matplotlib/backends/backend_gtk.py
Modified: branches/v1_0_maint/lib/matplotlib/backends/backend_gtk.py
===================================================================
--- branches/v1_0_maint/lib/matplotlib/backends/backend_gtk.py 2010-09-11 19:02:38 UTC (rev 8696)
+++ branches/v1_0_maint/lib/matplotlib/backends/backend_gtk.py 2010-09-11 19:03:52 UTC (rev 8697)
@@ -101,6 +101,9 @@
functions add_callback and remove_callback can be used.
'''
def _timer_start(self):
+ # Need to stop it, otherwise we potentially leak a timer id that will
+ # never be stopped.
+ self._timer_stop()
self._timer = gobject.timeout_add(self._interval, self._on_timer)
def _timer_stop(self):
@@ -109,6 +112,7 @@
self._timer = None
def _timer_set_interval(self):
+ # Only stop and restart it if the timer has already been started
if self._timer is not None:
self._timer_stop()
self._timer_start()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|