diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-09-05 15:37:52 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-09-05 15:41:51 +0200 |
commit | 28471f774b1fdca4f02e90064209f5b16f143aa4 (patch) | |
tree | b30b57612f30e2700cb610e6a5a984ae6f5ae82e /sfx2 | |
parent | CID#705762: fix memory leak (diff) | |
download | core-28471f774b1fdca4f02e90064209f5b16f143aa4.tar.gz core-28471f774b1fdca4f02e90064209f5b16f143aa4.zip |
CID#705713: fix memory leak
Change-Id: Ic157c57fcf3fd30fe46c8c09098d532fef9cd4b2
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/printhelper.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index 918d1ca52eed..603331c61873 100644 --- a/sfx2/source/doc/printhelper.cxx +++ b/sfx2/source/doc/printhelper.cxx @@ -680,7 +680,8 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& // of the URL. The URL we save for later using separately. // Execution of the print job will be done later by executing // a slot ... - pUCBPrintTempFile = new ::utl::TempFile(); + if(!pUCBPrintTempFile) + pUCBPrintTempFile = new ::utl::TempFile(); pUCBPrintTempFile->EnableKillingFile(); //FIXME: does it work? @@ -772,7 +773,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& // a) printing finished => move the file directly and forget the watcher thread // b) printing is asynchron and runs currently => start watcher thread and exit this method // This thread make all necessary things by itself. - if (pUCBPrintTempFile!=NULL) + if (pUCBPrintTempFile) { // a) SfxPrinter* pPrinter = pView->GetPrinter(); @@ -782,7 +783,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& else { // Note: we create(d) some resource on the heap. (thread and tep file) - // They will be delected by the thread automaticly if he finish his run() method. + // They will be deleted by the thread automaticly if he finish his run() method. ImplUCBPrintWatcher* pWatcher = new ImplUCBPrintWatcher( pPrinter, pUCBPrintTempFile, sUcbUrl ); pWatcher->create(); } |