diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2022-03-09 11:51:45 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2022-03-09 17:47:10 +0100 |
commit | 4e641d9240a981216d6724141b9b7a9e4c63c82a (patch) | |
tree | 85505fba46b623a49905ec7676510cecb6edc548 /accessibility/inc | |
parent | b86c4d962c7df4a5066ee634df88868b8bb287fe (diff) |
Related: tdf#147742 a11y: Dispose table cells as well
When disposing `AccessibleGridControlTable` (which
is done in `AccessibleGridControl::disposing`),
also dispose its cells and clear the references.
Without this in place, a crash sometimes occured
when running the macro in the sample doc from
tdf#147742 several times and clicking around in the
table, with the Orca screen reader active.
This was because a reference to one of
the `AccessibleGridControlTableCell`s was still
around after the `AccessibleGridControlTable`
had already been disposed, and when trying
to get its accessible name, the call to
`IAccessibleTable::GetAccessibleObjectName` in
`AccessibleGridControlCell::getAccessibleName`
would fail because the object that the
`m_aTable` reference was referring to had already
been deleted.
With the cell being disposed as well, the
`ensureIsAlive()` check at the beginning of
`AccessibleGridControlCell::getAccessibleName`
will throw a `DisposedException`, that is then
handled properly in the calling code.
Backtrace (with master as of commit
2598c35dbac8dc4492ad1fc79925c5347e683af0):
#0 0x00007fffd9152ed3 in accessibility::AccessibleGridControlCell::getAccessibleName() (this=0x55555bbcdb70) at /home/michi/development/git/libreoffice/accessibility/source/extended/AccessibleGridControlTableCell.cxx:79
#1 0x00007fffe45e864a in wrapper_get_name(AtkObject*) (atk_obj=0x55555bbcef60) at /home/michi/development/git/libreoffice/vcl/unx/gtk3/a11y/atkwrapper.cxx:369
#2 0x00007fffe3a87e5c in () at /lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0
#3 0x00007fffe3a947de in () at /lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0
#4 0x00007fffe3a94caf in () at /lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0
#5 0x00007ffff75feff0 in () at /lib/x86_64-linux-gnu/libdbus-1.so.3
#6 0x00007ffff75eea1c in dbus_connection_dispatch () at /lib/x86_64-linux-gnu/libdbus-1.so.3
#7 0x00007fffe36d74a5 in () at /lib/x86_64-linux-gnu/libatspi.so.0
#8 0x00007fffe9ab8cdb in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#9 0x00007fffe9ab8f88 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#10 0x00007fffe9ab903f in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#11 0x00007fffe460f546 in GtkSalData::Yield(bool, bool) (this=0x55555567c750, bWait=true, bHandleAllCurrentEvents=false) at /home/michi/development/git/libreoffice/vcl/unx/gtk3/gtkdata.cxx:405
#12 0x00007fffe461402a in GtkInstance::DoYield(bool, bool) (this=0x55555567c5d0, bWait=true, bHandleAllCurrentEvents=false) at /home/michi/development/git/libreoffice/vcl/unx/gtk3/gtkinst.cxx:427
#13 0x00007fffef7ab4be in ImplYield(bool, bool) (i_bWait=true, i_bAllEvents=false) at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:474
#14 0x00007fffef7ac0b0 in Application::Yield() () at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:558
#15 0x00007fffef7ab18e in Application::Execute() () at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:452
#16 0x00007ffff7c309af in desktop::Desktop::Main() (this=0x7fffffffd780) at /home/michi/development/git/libreoffice/desktop/source/app/app.cxx:1604
#17 0x00007fffef7c9d75 in ImplSVMain() () at /home/michi/development/git/libreoffice/vcl/source/app/svmain.cxx:202
#18 0x00007fffef7c9e96 in SVMain() () at /home/michi/development/git/libreoffice/vcl/source/app/svmain.cxx:234
#19 0x00007ffff7c947c9 in soffice_main() () at /home/michi/development/git/libreoffice/desktop/source/app/sofficemain.cxx:98
#20 0x00005555555549f4 in sal_main () at /home/michi/development/git/libreoffice/desktop/source/app/main.c:51
#21 0x00005555555549da in main (argc=4, argv=0x7fffffffdaf8) at /home/michi/development/git/libreoffice/desktop/source/app/main.c:49
Change-Id: Idffa76809cbfad746f27d18191fdfc905b64ee0e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131247
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'accessibility/inc')
-rw-r--r-- | accessibility/inc/extended/AccessibleGridControlTable.hxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/accessibility/inc/extended/AccessibleGridControlTable.hxx b/accessibility/inc/extended/AccessibleGridControlTable.hxx index bada75124257..602365468505 100644 --- a/accessibility/inc/extended/AccessibleGridControlTable.hxx +++ b/accessibility/inc/extended/AccessibleGridControlTable.hxx @@ -139,6 +139,9 @@ public: /** @return The name of this class. */ virtual OUString SAL_CALL getImplementationName() override; + // XComponent + virtual void SAL_CALL dispose() override; + /**@return m_pCellVector*/ std::vector< rtl::Reference<AccessibleGridControlTableCell> >& getCellVector() { return m_aCellVector;} |