summaryrefslogtreecommitdiff
path: root/sfx2/source/doc
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-14 08:20:53 +0100
commitc880d3e30405342a5ae6239cc77f69ed3ca6cc15 (patch)
tree66114edb519a8908326f08c82f04375e022aa6d5 /sfx2/source/doc
parentebe1f639cf65c20cee70aa55176bfb67e7b915f7 (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>
Diffstat (limited to 'sfx2/source/doc')
-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 0908d025852d..8a961ce7627f 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -2737,7 +2737,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 47c379a3a8f6..6ed21500a2a9 100644
--- a/sfx2/source/doc/printhelper.cxx
+++ b/sfx2/source/doc/printhelper.cxx
@@ -428,7 +428,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();
}
@@ -484,7 +484,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 :-)
}