From: Mads I. <mad...@gm...> - 2013-01-29 22:12:47
|
Hi, I spend some time writing up the question below on Stackoverflow which immediately was closed as a duplicate of other posts. To my best knowledge, these posts did not answer my questions - so I'll try my luck here instead: I am using the qt backengine for setting up a QWidget that embeds a matplotlib scene. When the widget is closed it appears that many of the matplotlib objects that were part of the plot still are alive in Python space. My question is basically the following: What actions should I take to clean up the figure and axes objects etc. that were part of the plot widget? The qt backend comes with a figure manager, but it appears a little unclear how it should be used. I have attached a small unit test example that sets up a plot. When the plot appears, just close it, and the test will garbage collects the plot, and then display info of the matplotlib objects that are still alive in Python space. Clearly both the path of the plot, and several Bbox objects are still referenced. Our current unit test suite contains almost 10000 GUI tests and its imperative that proper object space clean up is done after each test. Any help is much appreciated. Best regards, Mads -- +-----------------------------------------------------+ | Mads Ipsen | +----------------------+------------------------------+ | Gåsebæksvej 7, 4. tv | | | DK-2500 Valby | phone: +45-29716388 | | Denmark | email: mad...@gm... | +----------------------+------------------------------+ |