summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-03-06 13:43:21 +0100
committerMichael Stahl <mstahl@redhat.com>2014-03-06 14:57:02 +0100
commit2e29a518b04250b5f9cc9d0d77da3df076834d60 (patch)
tree629aba946088682e41c4365d67b6f0d270523ecb
parent535b1dadc202ecb65510e846fe21652a84f3c07d (diff)
sfx2: ensure that no timers are running after SfxApplication dies
Timers may access global data that's tied to SfxApplication, and that seems difficult to fix or prevent; the SfxApplication is deleted before the main thread gets around to handling the PostUserEvent sent by Application::Quit(). log from xmloff_unoapi: ==32095== Invalid read of size 8 ==32095== at 0x934D245: Font::Font(Font const&) (font.cxx:239) ==32095== by 0x1FCEABDF: ImpEditEngine::FormatDoc() (impedit3.cxx:381) [...] ==32095== by 0x1ED0F894: SdDrawDocument::LinkStubOnlineSpellingHdl(void*, void*) (drawdoc4.cxx:826) ==32095== by 0x911FECD: Link::Call(void*) const (link.hxx:123) ==32095== by 0x914F700: Timer::Timeout() (timer.cxx:224) ==32095== by 0x914F394: Timer::ImplTimerCallbackProc() (timer.cxx:121) ==32095== by 0x170B350A: SalTimer::CallCallback() (saltimer.hxx:53) ==32095== by 0x170B26C6: SvpSalInstance::CheckTimeout(bool) (svpinst.cxx:188) ==32095== by 0x170B2D25: SvpSalInstance::Yield(bool, bool) (svpinst.cxx:317) ==32095== by 0x91460DF: ImplYield(bool, bool) (svapp.cxx:363) ==32095== by 0x9142814: Application::Yield() (svapp.cxx:395) ==32095== by 0x91427C2: Application::Execute() (svapp.cxx:344) ==32095== by 0x4EC7589: desktop::Desktop::Main() (app.cxx:1680) ==32095== Address 0x1d498b28 is 408 bytes inside a block of size 520 free'd ==32095== at 0x4A078DE: operator delete(void*) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==32095== by 0x954CFE5: VirtualDevice::~VirtualDevice() (virdev.cxx:202) ==32095== by 0x1EE26F7D: SdModule::~SdModule() (sdmod.cxx:128) ==32095== by 0x1EE26FFD: SdModule::~SdModule() (sdmod.cxx:129) ==32095== by 0x65C9E47: SfxModule::DestroyModules_Impl() (module.cxx:327) ==32095== by 0x654116A: SfxApplication::~SfxApplication() (app.cxx:226) ==32095== by 0x6541249: SfxApplication::~SfxApplication() (app.cxx:244) ==32095== by 0x655E452: SfxTerminateListener_Impl::notifyTermination(com::sun::star::lang::EventObject const&) (appinit.cxx:121) ==32095== by 0x1B8A67A1: framework::Desktop::terminate() (desktop.cxx:343) Change-Id: Ib70444c2b0fc60daa094323510d20b146a416087
-rw-r--r--sfx2/source/appl/appinit.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx
index 3d9a8c3036c5..5cbf85cd557a 100644
--- a/sfx2/source/appl/appinit.cxx
+++ b/sfx2/source/appl/appinit.cxx
@@ -45,6 +45,7 @@
#include <cppuhelper/supportsservice.hxx>
#include <vcl/edit.hxx>
+#include <vcl/timer.hxx>
#include <sfx2/unoctitm.hxx>
#include "app.hrc"
@@ -106,6 +107,10 @@ void SAL_CALL SfxTerminateListener_Impl::notifyTermination( const EventObject& a
SolarMutexGuard aGuard;
utl::ConfigManager::storeConfigItems();
+ // Timers may access the SfxApplication and are only deleted in
+ // Application::Quit(), which is asynchronous (PostUserEvent) - disable!
+ Timer::ImplDeInitTimer();
+
SfxApplication* pApp = SFX_APP();
pApp->Broadcast( SfxSimpleHint( SFX_HINT_DEINITIALIZING ) );
pApp->Get_Impl()->pAppDispatch->ReleaseAll();