Commit 79f10204 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix mem leak

parent 8031da96
......@@ -154,12 +154,14 @@ void ArticleViewerWebEngineWidgetNg::printRequested(QWebEnginePage *page)
if (mCurrentPrinter)
return;
mCurrentPrinter = new QPrinter();
QPrintDialog *dialog = new QPrintDialog(mCurrentPrinter, this);
QPointer<QPrintDialog> dialog = new QPrintDialog(mCurrentPrinter, this);
dialog->setWindowTitle(i18n("Print Document"));
if (dialog->exec() != QDialog::Accepted) {
slotHandlePagePrinted(false);
delete dialog;
return;
}
delete dialog;
page->print(mCurrentPrinter, invoke(this, &ArticleViewerWebEngineWidgetNg::slotHandlePagePrinted));
#endif
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment