diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-05-12 13:47:38 +0200 |
---|---|---|
committer | Björn Michaelsen <bjoern.michaelsen@canonical.com> | 2015-05-12 17:21:10 +0000 |
commit | 098817edf3c5d16ab476fbb996807e7654597990 (patch) | |
tree | 5e6a3a74ed09439abd7af516e467a27da83bdd26 | |
parent | 0be1277c5ad9f3ea2e8ff78c12431f8c512293cc (diff) |
tdf#90969: basic: add horrible hack to avoid crash due to ...
... the stupid global variable GaDocBasicItems.
Change-Id: Ib849e0e2b661e54005d00091f6d6fc474dc5549b
(cherry picked from commit be88e305eeac88e51f83efc004d4b60b87f1e757)
Reviewed-on: https://gerrit.libreoffice.org/15715
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
-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 c24828ae691e..2f5be5622b9b 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 ) |