diff --git a/connectivity/Library_hsqldb.mk b/connectivity/Library_hsqldb.mk index 40764b9237d8..9b950eb6e7c7 100644 --- a/connectivity/Library_hsqldb.mk +++ b/connectivity/Library_hsqldb.mk @@ -32,6 +32,7 @@ $(eval $(call gb_Library_use_libraries,hsqldb,\ salhelper \ tl \ utl \ + vcl \ i18nlangtag \ )) diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx index 91cab732fcee..f43584d1f169 100644 --- a/connectivity/source/drivers/hsqldb/HDriver.cxx +++ b/connectivity/source/drivers/hsqldb/HDriver.cxx @@ -52,6 +52,7 @@ #include #include #include +#include #include @@ -534,7 +535,14 @@ namespace connectivity if ( xRow.is() && xRes->next() ) bLastOne = xRow->getInt(1) == 1; if ( bLastOne ) + { + // during shutdown, we are running on the main thread, and if we call this, + // it might trigger dbaccess::DocumentEventNotifier_Impl::impl_notifyEvent_nothrow + // which is running on a different thread, and that will call other code that tries + // to take the solar mutex. + SolarMutexReleaser aReleaser; xStmt->execute(u"SHUTDOWN"_ustr); + } } } }