Revision: 4404
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4404&view=rev
Author: mdboom
Date: 2007-11-21 08:05:18 -0800 (Wed, 21 Nov 2007)
Log Message:
-----------
Fix memory leak when using colorbar as discovered by Darren Dale. The
(unit change) callbacks in the Axis objects were not cleared by cla(),
so they would continue to grow long lists of callbacks that reference
entire Axes objects.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axis.py
Modified: trunk/matplotlib/lib/matplotlib/axis.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axis.py 2007-11-21 15:27:14 UTC (rev
4403)
+++ trunk/matplotlib/lib/matplotlib/axis.py 2007-11-21 16:05:18 UTC (rev
4404)
@@ -533,6 +533,9 @@
self.set_minor_locator(NullLocator())
self.set_minor_formatter(NullFormatter())
+ # Clear the callback registry for this axis, or it may "leak"
+ self.callbacks = CallbackRegistry(('units', 'units finalize'))
+
# whether the grids are on
self._gridOnMajor = rcParams['axes.grid']
self._gridOnMinor = False
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins