Fix failing assert on shutdown with NVDA active
commit71dd214624675afe3267d467d588afd1ce3eb693
authorMike Kaganski <mike.kaganski@collabora.com>
Sat, 28 May 2022 18:04:40 +0000 (28 20:04 +0200)
committerMike Kaganski <mike.kaganski@collabora.com>
Sun, 29 May 2022 10:40:19 +0000 (29 12:40 +0200)
tree38f02f313e2de1beb8189f694458ff9315612a05
parent8ec7b04808b8aca32e2c38b8042af9b3c9bbe071
Fix failing assert on shutdown with NVDA active

The stack trace at the moment of calling implLookupClient with
nClient == -1 was:

> ucrtbased.dll!abort() Line 61 C++
> ucrtbased.dll!common_assert_to_stderr<wchar_t>(const wchar_t * const expression, const wchar_t * const file_name, const unsigned int line_number) Line 187 C++
> ucrtbased.dll!common_assert<wchar_t>(const wchar_t * const expression, const wchar_t * const file_name, const unsigned int line_number, void * const return_address) Line 420 C++
> ucrtbased.dll!_wassert(const wchar_t * expression, const wchar_t * file_name, unsigned int line_number) Line 444 C++
> comphelper.dll!`anonymous namespace'::implLookupClient(const unsigned long nClient, std::_Tree_iterator<std::_Tree_val<std::_Tree_simple_types<std::pair<unsigned long const ,comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> *>>>> & rPos) Line 139 C++
> comphelper.dll!comphelper::AccessibleEventNotifier::addEvent(const unsigned long _nClient, const com::sun::star::accessibility::AccessibleEventObject & _rEvent) Line 249 C++
> svxlo.dll!accessibility::AccessibleTextHelper_Impl::FireEvent(const com::sun::star::accessibility::AccessibleEventObject & rEvent) Line 1416 C++
> svxlo.dll!accessibility::AccessibleTextHelper_Impl::FireEvent(const short nEventId, const com::sun::star::uno::Any & rNewValue, const com::sun::star::uno::Any & rOldValue) Line 1408 C++
> svxlo.dll!accessibility::AccessibleTextHelper_Impl::ShutdownEditSource() Line 700 C++
> svxlo.dll!accessibility::AccessibleTextHelper_Impl::SetEditSource(std::unique_ptr<SvxEditSource,std::default_delete<SvxEditSource>> && pEditSource) Line 717 C++
> svxlo.dll!accessibility::AccessibleTextHelper::SetEditSource(std::unique_ptr<SvxEditSource,std::default_delete<SvxEditSource>> && pEditSource) Line 1548 C++
> svxlo.dll!WeldEditAccessible::ClearWin() Line 552 C++
> svxlo.dll!WeldEditView::~WeldEditView() Line 864 C++
> smlo.dll!SmEditTextWindow::~SmEditTextWindow() Line 85 C++
> smlo.dll!SmEditTextWindow::`scalar deleting destructor'(unsigned int) C++
> smlo.dll!std::default_delete<SmEditTextWindow>::operator()(SmEditTextWindow * _Ptr) Line 3129 C++
> smlo.dll!std::unique_ptr<SmEditTextWindow,std::default_delete<SmEditTextWindow>>::reset(SmEditTextWindow * _Ptr) Line 3276 C++
> smlo.dll!SmEditWindow::DeleteEditView() Line 853 C++
> smlo.dll!SmEditWindow::~SmEditWindow() Line 139 C++
> smlo.dll!SmEditWindow::`scalar deleting destructor'(unsigned int) C++
> smlo.dll!o3tl::default_delete<SmEditWindow>::operator()(SmEditWindow * p) Line 46 C++
> smlo.dll!std::unique_ptr<SmEditWindow,o3tl::default_delete<SmEditWindow>>::reset(SmEditWindow * _Ptr) Line 3276 C++
> smlo.dll!SmCmdBoxWindow::dispose() Line 931 C++
> vcllo.dll!VclReferenceBase::disposeOnce() Line 39 C++
> sfxlo.dll!VclPtr<vcl::Window>::disposeAndClear() Line 206 C++
> sfxlo.dll!SfxChildWindow::~SfxChildWindow() Line 198 C++
> smlo.dll!SmCmdBoxWrapper::~SmCmdBoxWrapper() C++
> smlo.dll!SmCmdBoxWrapper::`scalar deleting destructor'(unsigned int) C++
> sfxlo.dll!SfxChildWindow::Destroy() Line 176 C++
> sfxlo.dll!SfxWorkWindow::DeleteControllers_Impl() Line 599 C++
> sfxlo.dll!SfxFrame::DoClose_Impl() Line 133 C++
> sfxlo.dll!SfxBaseController::dispose() Line 981 C++
> fwklo.dll!`anonymous namespace'::XFrameImpl::setComponent(const com::sun::star::uno::Reference<com::sun::star::awt::XWindow> & xComponentWindow, const com::sun::star::uno::Reference<com::sun::star::frame::XController> & xController) Line 1485 C++
> fwklo.dll!`anonymous namespace'::XFrameImpl::close(unsigned char bDeliverOwnership) Line 1696 C++
> fwklo.dll!framework::Desktop::impl_closeFrames(bool bAllowUI) Line 1702 C++
> fwklo.dll!framework::Desktop::terminate() Line 214 C++
> fwklo.dll!framework::CloseDispatcher::implts_terminateApplication() Line 543 C++
> fwklo.dll!framework::CloseDispatcher::impl_asyncCallback(LinkParamNone * __formal) Line 397 C++
> fwklo.dll!framework::CloseDispatcher::LinkStubimpl_asyncCallback(void * instance, LinkParamNone * data) Line 245 C++
> vcllo.dll!Link<LinkParamNone *,void>::Call(LinkParamNone * data) Line 111 C++
> vcllo.dll!vcl::EventPoster::DoEvent_Impl(void * __formal) Line 53 C++
> vcllo.dll!vcl::EventPoster::LinkStubDoEvent_Impl(void * instance, void * data) Line 48 C++
> vcllo.dll!Link<void *,void>::Call(void * data) Line 111 C++
> vcllo.dll!ImplHandleUserEvent(ImplSVEvent * pSVEvent) Line 2232 C++
> vcllo.dll!ImplWindowFrameProc(vcl::Window * _pWindow, SalEvent nEvent, const void * pEvent) Line 2800 C++
> vcllo.dll!SalFrame::CallCallback(SalEvent nEvent, const void * pEvent) Line 308 C++
> vclplug_winlo.dll!ImplHandleUserEvent(HWND__ * hWnd, __int64 lParam) Line 4214 C++
> vclplug_winlo.dll!SalFrameWndProc(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam, bool & rDef) Line 5865 C++
> vclplug_winlo.dll!SalFrameWndProcW(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 5972 C++
> user32.dll!UserCallWinProcCheckWow() Unknown
> user32.dll!DispatchMessageWorker() Unknown
> vclplug_winlo.dll!ImplSalDispatchMessage(const tagMSG * pMsg) Line 475 C++
> vclplug_winlo.dll!ImplSalYield(bool bWait, bool bHandleAllCurrentEvents) Line 506 C++
> vclplug_winlo.dll!WinSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents) Line 581 C++
> vcllo.dll!ImplYield(bool i_bWait, bool i_bAllEvents) Line 474 C++
> vcllo.dll!Application::Yield() Line 559 C++
> vcllo.dll!Application::Execute() Line 452 C++
> sofficeapp.dll!desktop::Desktop::Main() Line 1600 C++
> vcllo.dll!ImplSVMain() Line 202 C++
> vcllo.dll!SVMain() Line 235 C++
> sofficeapp.dll!soffice_main() Line 94 C++
> soffice.bin!sal_main() Line 51 C
> soffice.bin!main(int argc, char * * argv) Line 49 C

Firing the event when we already set the id to mean "revoked"
seems wrong. Also use the correct type for the id.

Change-Id: Ie2e180c0c8c112023f789968ffa785f046de9d76
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135058
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
svx/source/accessibility/AccessibleTextHelper.cxx