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>
This commit is contained in:
Tomaz Canabrava 2016-01-08 15:46:24 -02:00 committed by Dirk Hohndel
parent f07a9fa09f
commit 04d4da50c4

View file

@ -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 =