summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/templatelayout.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2016-01-08 15:46:24 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-01-08 10:03:12 -0800
commit04d4da50c4b760e2714b020fb8becd48ed6470c9 (patch)
treefe9b71fcfebba11da689e15b923086cc53bc102e /desktop-widgets/templatelayout.cpp
parentf07a9fa09f06ca2b5f4ea5f501c3825c031a74fc (diff)
downloadsubsurface-04d4da50c4b760e2714b020fb8becd48ed6470c9.tar.gz
Fix memory leak on the printing system
We forgot to delete the Grantlee object before creating a new one Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets/templatelayout.cpp')
-rw-r--r--desktop-widgets/templatelayout.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/desktop-widgets/templatelayout.cpp b/desktop-widgets/templatelayout.cpp
index 5130c2a54..f955666b8 100644
--- a/desktop-widgets/templatelayout.cpp
+++ b/desktop-widgets/templatelayout.cpp
@@ -56,6 +56,7 @@ QString TemplateLayout::generate()
int totalWork = getTotalWork(PrintOptions);
QString htmlContent;
+ delete m_engine;
m_engine = new Grantlee::Engine(this);
QSharedPointer<Grantlee::FileSystemTemplateLoader> m_templateLoader =
@@ -94,7 +95,6 @@ QString TemplateLayout::generate()
if (t->error()) {
qDebug() << "Can't render template";
- return htmlContent;
}
return htmlContent;
}
@@ -102,6 +102,7 @@ QString TemplateLayout::generate()
QString TemplateLayout::generateStatistics()
{
QString htmlContent;
+ delete m_engine;
m_engine = new Grantlee::Engine(this);
QSharedPointer<Grantlee::FileSystemTemplateLoader> m_templateLoader =