author | leseb <leseb> | 2002-03-29 20:21:17 (UTC) |
---|---|---|
committer | leseb <leseb> | 2002-03-29 20:21:17 (UTC) |
commit | 1c3f2b3a329eac52d2a735d818cd70101376999f (patch) (side-by-side diff) | |
tree | 834cc3c1542d5059abf87c7e890b77f390c13116 | |
parent | dee656e9bf63cc44f906375d5b24cd953a945a8f (diff) | |
download | opie-1c3f2b3a329eac52d2a735d818cd70101376999f.zip opie-1c3f2b3a329eac52d2a735d818cd70101376999f.tar.gz opie-1c3f2b3a329eac52d2a735d818cd70101376999f.tar.bz2 |
Memory leak, null pointer fixes
-rw-r--r-- | noncore/graphics/drawpad/drawpad.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/noncore/graphics/drawpad/drawpad.cpp b/noncore/graphics/drawpad/drawpad.cpp index 5c7e541..aae9ab0 100644 --- a/noncore/graphics/drawpad/drawpad.cpp +++ b/noncore/graphics/drawpad/drawpad.cpp @@ -477,25 +477,30 @@ void DrawPad::updateCaption() setCaption(tr("DrawPad") + " - " + tr("Page") + " " + QString::number(pagePosition) + "/" + QString::number(pageCount)); } void DrawPad::importPage() { ImportDialog importDialog(this); importDialog.showMaximized(); if (importDialog.exec() == QDialog::Accepted) { - m_pDrawPadCanvas->importPage(importDialog.selected()->file()); + const DocLnk* docLnk = importDialog.selected(); + + if (docLnk) { + m_pDrawPadCanvas->importPage(docLnk->file()); + delete docLnk; + } } } void DrawPad::exportPage() { ExportDialog exportDialog(m_pDrawPadCanvas->pagePosition(), m_pDrawPadCanvas->pageCount(), this); exportDialog.showMaximized(); if (exportDialog.exec() == QDialog::Accepted) { m_pDrawPadCanvas->exportPage(exportDialog.selectedFromPage(), exportDialog.selectedToPage(), exportDialog.selectedName(), exportDialog.selectedFormat()); |