CppunitTest_desktop_lib: fix stack-use-after-return

The LOK callback objects registered are on-stack objects, so we must be
sure that references no longer used after we return.

Process idle events, so that desktop::CallbackHandler::flush() won't try
to use the reference after return.

Change-Id: I65d324cb9cef4fd1776d0f610d8d096717e0e833
Reviewed-on: https://gerrit.libreoffice.org/30034
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
This commit is contained in:
Miklos Vajna
2016-10-19 09:45:07 +02:00
parent d6ff3d49df
commit 0c34cd41c6

View File

@@ -1639,6 +1639,7 @@ void DesktopLOKTest::testPaintPartTile()
// the first view, so there were no invalidations. // the first view, so there were no invalidations.
CPPUNIT_ASSERT(aView1.m_bTilesInvalidated); CPPUNIT_ASSERT(aView1.m_bTilesInvalidated);
Scheduler::ProcessEventsToIdle();
mxComponent->dispose(); mxComponent->dispose();
mxComponent.clear(); mxComponent.clear();
comphelper::LibreOfficeKit::setActive(false); comphelper::LibreOfficeKit::setActive(false);
@@ -1678,6 +1679,7 @@ void DesktopLOKTest::testWriterCommentInsertCursor()
// inserted the comment. // inserted the comment.
CPPUNIT_ASSERT(aView1.m_aOwnCursor.IsEmpty()); CPPUNIT_ASSERT(aView1.m_aOwnCursor.IsEmpty());
Scheduler::ProcessEventsToIdle();
mxComponent->dispose(); mxComponent->dispose();
mxComponent.clear(); mxComponent.clear();
comphelper::LibreOfficeKit::setActive(false); comphelper::LibreOfficeKit::setActive(false);