summaryrefslogtreecommitdiff
path: root/basic
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 /basic
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 'basic')
-rw-r--r--basic/source/classes/sbxmod.cxx2
-rw-r--r--basic/source/runtime/methods1.cxx2
2 files changed, 2 insertions, 2 deletions
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 0596e5ba87d9..c4e42b67b85c 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -1122,7 +1122,7 @@ void SbModule::Run( SbMethod* pMeth )
if( bDelInst )
{
// Compare here with 1 instead of 0, because before nCallLvl--
- while (pSbData->pInst->nCallLvl != 1)
+ while (pSbData->pInst->nCallLvl != 1 && !Application::IsQuit())
Application::Yield();
}
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index 19f0acaa8c0a..f0f1e3ded591 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -582,7 +582,7 @@ void Wait_Impl( bool bDurationBased, SbxArray& rPar )
Timer aTimer;
aTimer.SetTimeout( nWait );
aTimer.Start();
- while ( aTimer.IsActive() )
+ while ( aTimer.IsActive() && !Application::IsQuit())
{
Application::Yield();
}