vcl/source/app/svmain.cxx | 3 +++
1 file changed, 3 insertions(+)
New commits:
commit e1bcdbc6ee0899f3cb915c7a64a1c3b0d42ba977
Author: Mike Kaganski <[email protected]>
AuthorDate: Wed Mar 13 10:15:07 2024 +0500
Commit: Mike Kaganski <[email protected]>
CommitDate: Wed Mar 13 08:56:07 2024 +0100
Process pending events before ImplDeleteOnDeInit
The statics derived from DeleteOnDeinitBase are destroyed in the call
to ImplDeleteOnDeInit; and then they may be accessed, when a few lines
later, Scheduler::ImplDeInitScheduler is called, which itself calls
ProcessEventsToIdle. This change makes sure that the events, that may
potentially want to access these objects, are executed at a safe time.
Change-Id: Idc04100453ed12def815b721e3efe76cb3ca1100
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164752
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <[email protected]>
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 3aa2cecf4ec8..a93bda31bbc6 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -466,6 +466,9 @@ void DeInitVCL()
pSVData->mpBlendFrameCache->m_aLastResult.Clear();
pSVData->mbDeInit = true;
+ // Some events may need to access objects destroyed in ImplDeleteOnDeInit,
so process them first
+ Scheduler::ProcessEventsToIdle();
+
vcl::DeleteOnDeinitBase::ImplDeleteOnDeInit();
#if OSL_DEBUG_LEVEL > 0