bicycle-statistics: Fix memory leak

Signed-off-by: Thomas Klaehn <thomas.klaehn@u-blox.com>
This commit is contained in:
Thomas Klaehn
2019-02-28 09:21:18 +01:00
parent 102642d4ba
commit 06ecfdf0fe
3 changed files with 16 additions and 15 deletions

View File

@@ -45,6 +45,7 @@ def plot_bar_chart(labels, ticklabels, values, title, xlabel, ylabel, filename,
plt.legend()
plt.savefig(filename)
plt.close('all')
class Gpx2Html(object):
def __init__(self, infolder, outfolder, logger):
@@ -52,6 +53,9 @@ class Gpx2Html(object):
self.infolder = infolder
self.outfolder = os.path.abspath(outfolder)
if not os.path.exists(self.outfolder):
os.makedirs(self.outfolder)
self.tracks = Tracks(logger)
self.update()