mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
cleanup: free print dialog in planner
When printing the plan, a print-dialog was created with "new", but not freed later. Strictly speaking, this is not a leak, because the dialog is attached to the main-window in Qt's object hierarchy. Thus it is freed on application exit. On the other hand, it is a leak in the sense that resources are pointlessly hogged until application exit. Let's just turn it into a stack-allocated object. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
b95ab84226
commit
3e1ade5206
1 changed files with 3 additions and 3 deletions
|
@ -588,9 +588,9 @@ void PlannerWidgets::printDecoPlan()
|
|||
free(disclaimer);
|
||||
|
||||
QPrinter printer;
|
||||
QPrintDialog *dialog = new QPrintDialog(&printer, MainWindow::instance());
|
||||
dialog->setWindowTitle(tr("Print runtime table"));
|
||||
if (dialog->exec() != QDialog::Accepted)
|
||||
QPrintDialog dialog(&printer, MainWindow::instance());
|
||||
dialog.setWindowTitle(tr("Print runtime table"));
|
||||
if (dialog.exec() != QDialog::Accepted)
|
||||
return;
|
||||
|
||||
/* render the profile as a pixmap that is inserted as base64 data into a HTML <img> tag
|
||||
|
|
Loading…
Reference in a new issue