Files
loongoffice/framework/source/layoutmanager
Michael Stahl 84f2ff67a7 framework: fix race in ToolBarManager creation
ToolbarLayoutManager::createToolbar() may be called concurrently on
different threads, and then it can happen that both threads want to
create the same toolbar URL, see that it does not exist in line 457,
then both release the SolarMutex and create a new ToolBarManager
and the first inserts it and then the second overwrites it on line 514
without disposing the first one.

The non-disposed extra ToolBarManager is kept alive because it is
registered as a listener on the Frame.  When the Frame::close() is
called, the ToolbarLayoutManager is disposed, and that disposes all the
ToolBarManagers it knows about, but not the extra one, which is
then un-ref'd and then has a live VclPtr m_pToolBar, which asserts
because the SolarMutex is not locked since commit
e794ce1eef6730e5a46d5fb0aa6db2895ede85e7.

(This commit is thanks to rr, which recorded the
JunitTest_framework_complex execution and allowed debugging this.)

Change-Id: I8f5333e8e36ac8ea347ef545e014ffc10501aebb
2016-12-10 00:03:08 +01:00
..