diff options
-rw-r--r-- | basic/source/classes/sb.cxx | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 559cb3cb36f9..a8f1bc699332 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -24,6 +24,7 @@ #include <tools/rcid.h> #include <tools/stream.hxx> #include <tools/errinf.hxx> +#include <tools/solarmutex.hxx> #include <basic/sbx.hxx> #include <tools/rc.hxx> #include <vcl/svapp.hxx> @@ -109,10 +110,22 @@ DocBasicItem::DocBasicItem( StarBASIC& rDocBasic ) : DocBasicItem::~DocBasicItem() { - SolarMutexGuard g; + // tdf#90969 HACK: don't use SolarMutexGuard - there is a horrible global + // map GaDocBasicItems holding instances, and these get deleted from exit + // handlers, when the SolarMutex is already dead + tools::SolarMutex::Acquire(); - stopListening(); - mxClassModules.Clear(); // release with SolarMutex locked + try + { + stopListening(); + mxClassModules.Clear(); // release with SolarMutex locked + } + catch (...) + { + assert(false); + } + + tools::SolarMutex::Release(); } void DocBasicItem::clearDependingVarsOnDelete( StarBASIC& rDeletedBasic ) |