mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 23:13:25 +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);
|
||||
|
||||
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 =
|
||||
|
|
Loading…
Add table
Reference in a new issue