mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
f07a9fa09f
commit
04d4da50c4
1 changed files with 2 additions and 1 deletions
|
@ -56,6 +56,7 @@ QString TemplateLayout::generate()
|
||||||
int totalWork = getTotalWork(PrintOptions);
|
int totalWork = getTotalWork(PrintOptions);
|
||||||
|
|
||||||
QString htmlContent;
|
QString htmlContent;
|
||||||
|
delete m_engine;
|
||||||
m_engine = new Grantlee::Engine(this);
|
m_engine = new Grantlee::Engine(this);
|
||||||
|
|
||||||
QSharedPointer<Grantlee::FileSystemTemplateLoader> m_templateLoader =
|
QSharedPointer<Grantlee::FileSystemTemplateLoader> m_templateLoader =
|
||||||
|
@ -94,7 +95,6 @@ QString TemplateLayout::generate()
|
||||||
|
|
||||||
if (t->error()) {
|
if (t->error()) {
|
||||||
qDebug() << "Can't render template";
|
qDebug() << "Can't render template";
|
||||||
return htmlContent;
|
|
||||||
}
|
}
|
||||||
return htmlContent;
|
return htmlContent;
|
||||||
}
|
}
|
||||||
|
@ -102,6 +102,7 @@ QString TemplateLayout::generate()
|
||||||
QString TemplateLayout::generateStatistics()
|
QString TemplateLayout::generateStatistics()
|
||||||
{
|
{
|
||||||
QString htmlContent;
|
QString htmlContent;
|
||||||
|
delete m_engine;
|
||||||
m_engine = new Grantlee::Engine(this);
|
m_engine = new Grantlee::Engine(this);
|
||||||
|
|
||||||
QSharedPointer<Grantlee::FileSystemTemplateLoader> m_templateLoader =
|
QSharedPointer<Grantlee::FileSystemTemplateLoader> m_templateLoader =
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue