LOK: disable LOKit in unit-tests only after destroying all

Desktop / LibreOffice - Ashod Nakashian [collabora.co.uk] - 2 October 2019 14:50 EDT

When we disable LOKit at the end of a unit-test, we do so before any of the smart-pointers go out of scope. These instances are then destroyed when LOKit is no longer active, in spite of the fact that they were created while it was.

This leaves some dialog/window routing notifiers dangling, which cause assertion failures and access-after-free (when they are invoked on destruction inadvertently). The latter issue was found with 'make CppunitTest_sd_tiledrendering
VALGRIND=memcheck'.

The fix is to move these flags to the setup and teardown stages of cpp-unit.

Change-Id: Ic4481305ca1a5cca14d70a4ebbc820a3fdeea9cc Reviewed-on: https://gerrit.libreoffice.org/80028

13fb343e3c48 LOK: disable LOKit in unit-tests only after destroying all
desktop/qa/desktop_lib/test_desktop_lib.cxx | 90 ++--------------------------
sd/qa/unit/tiledrendering/tiledrendering.cxx | 59 +-----------------
2 files changed, 7 insertions(+), 142 deletions(-)

Upstream: cgit.freedesktop.org


  • Share