summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-03-13 09:36:46 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-03-16 07:52:46 +0100
commitcda7357a82b3be7b60cc314cecbc59922beda629 (patch)
tree0e5176025c1253802f16fe54da03b7d2b2d0647a /sfx2
parent8ff147f200e6514bbc7e7d7b5ca91694b9234bfc (diff)
check for quit when calling Yield in loop
so we don't get stuck threads when the main application quits Change-Id: Id36e99267ceb4154873b6ef8ef494622fff6c19a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112409 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com> (cherry picked from commit c880d3e30405342a5ae6239cc77f69ed3ca6cc15) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112491 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/docfile.cxx2
-rw-r--r--sfx2/source/doc/printhelper.cxx4
2 files changed, 3 insertions, 3 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index ae24bf153ea2..afcb06d08478 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -2750,7 +2750,7 @@ void SfxMedium::Download( const Link<void*,void>& aLink )
GetInStream();
if ( pImpl->m_pInStream && !aLink.IsSet() )
{
- while( !pImpl->bDownloadDone )
+ while( !pImpl->bDownloadDone && !Application::IsQuit())
Application::Yield();
}
}
diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx
index 661074a9a102..7be718388e26 100644
--- a/sfx2/source/doc/printhelper.cxx
+++ b/sfx2/source/doc/printhelper.cxx
@@ -436,7 +436,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue >
//wait until printing is done
SfxPrinter* pDocPrinter = pViewSh->GetPrinter();
- while ( pDocPrinter->IsPrinting() )
+ while ( pDocPrinter->IsPrinting() && !Application::IsQuit())
Application::Yield();
}
@@ -491,7 +491,7 @@ class ImplUCBPrintWatcher : public ::osl::Thread
/* SAFE { */
{
SolarMutexGuard aGuard;
- while( m_pPrinter->IsPrinting() )
+ while( m_pPrinter->IsPrinting() && !Application::IsQuit())
Application::Yield();
m_pPrinter.clear(); // don't delete it! It's borrowed only :-)
}