[Libreoffice-commits] core.git: 4 commits - connectivity/source external/firebird
Norbert Thiebaud
nthiebaud at gmail.com
Sat Jun 28 07:56:56 PDT 2014
connectivity/source/drivers/firebird/Connection.cxx | 12 ++++++------
connectivity/source/drivers/firebird/Connection.hxx | 4 +---
connectivity/source/drivers/firebird/Driver.cxx | 2 ++
external/firebird/ExternalProject_firebird.mk | 1 -
4 files changed, 9 insertions(+), 10 deletions(-)
New commits:
commit 715ecfe3617cf13fd8d994e4322c3bbcc093e5cd
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date: Sat Jun 28 16:54:07 2014 +0200
firebird driver: shutdown explicitely firebird on dispose of driver.
Change-Id: Ia44f7e01a3a01da57e4d9382f41511aa6f987b43
diff --git a/connectivity/source/drivers/firebird/Driver.cxx b/connectivity/source/drivers/firebird/Driver.cxx
index c14e1f2..a6eacc6 100644
--- a/connectivity/source/drivers/firebird/Driver.cxx
+++ b/connectivity/source/drivers/firebird/Driver.cxx
@@ -110,6 +110,8 @@ void FirebirdDriver::disposing()
osl_clearEnvironment(our_sFirebirdMsgVar.pData);
#endif
+ OSL_VERIFY(fb_shutdown(0, 1));
+
ODriver_BASE::disposing();
}
commit 9015333ebd5b33c9c6c3a9072167af4c77d6d75a
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date: Sat Jun 28 16:52:54 2014 +0200
firebird: release driver on dispose rather than destroy.
Change-Id: I5ffeaf818c1eb4985bdd150830f089f03fe42ceb
diff --git a/connectivity/source/drivers/firebird/Connection.cxx b/connectivity/source/drivers/firebird/Connection.cxx
index 1ad4f44..2d846d8 100644
--- a/connectivity/source/drivers/firebird/Connection.cxx
+++ b/connectivity/source/drivers/firebird/Connection.cxx
@@ -77,7 +77,7 @@ const OUString Connection::our_sDBLocation( "firebird.fdb" );
Connection::Connection(FirebirdDriver* _pDriver)
: Connection_BASE(m_aMutex)
, OSubComponent<Connection, Connection_BASE>((::cppu::OWeakObject*)_pDriver, this)
- , m_pDriver(_pDriver)
+ , m_xDriver(_pDriver)
, m_sConnectionURL()
, m_sFirebirdURL()
, m_bIsEmbedded(false)
@@ -93,16 +93,12 @@ Connection::Connection(FirebirdDriver* _pDriver)
, m_xMetaData(0)
, m_aStatements()
{
- m_pDriver->acquire();
}
Connection::~Connection()
{
if(!isClosed())
close();
-
- m_pDriver->release();
- m_pDriver = 0;
}
void SAL_CALL Connection::release() throw()
@@ -348,7 +344,7 @@ OUString Connection::transformPreparedStatement(const OUString& _sSQL)
OUString sSqlStatement (_sSQL);
try
{
- OSQLParser aParser( m_pDriver->getContext() );
+ OSQLParser aParser( m_xDriver->getContext() );
OUString sErrorMessage;
OUString sNewSql;
OSQLParseNode* pNode = aParser.parseTree(sErrorMessage,_sSQL);
@@ -758,6 +754,7 @@ void Connection::disposing()
dispose_ChildImpl();
cppu::WeakComponentImplHelperBase::disposing();
+ m_xDriver.clear();
}
void Connection::disposeStatements()
diff --git a/connectivity/source/drivers/firebird/Connection.hxx b/connectivity/source/drivers/firebird/Connection.hxx
index 1c783bb..d613263 100644
--- a/connectivity/source/drivers/firebird/Connection.hxx
+++ b/connectivity/source/drivers/firebird/Connection.hxx
@@ -83,7 +83,7 @@ namespace connectivity
// for each row returned by
// DatabaseMetaData.getTypeInfo.
/** The parent driver that created this connection. */
- FirebirdDriver* m_pDriver;
+ ::rtl::Reference<FirebirdDriver> m_xDriver;
/** The URL passed to us when opening, i.e. of the form sdbc:* */
::rtl::OUString m_sConnectionURL;
@@ -179,8 +179,6 @@ namespace connectivity
throw(::com::sun::star::sdbc::SQLException,
::com::sun::star::uno::RuntimeException);
- FirebirdDriver* getDriver() const {return m_pDriver;}
-
::rtl::OUString getConnectionURL() const {return m_sConnectionURL;}
bool isEmbedded() const {return m_bIsEmbedded;}
::rtl::OUString getUserName() const {return m_sUser;}
commit ae6551b43d6cde10edb449cca6d2caa8fa428b20
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date: Sat Jun 28 16:50:21 2014 +0200
firebird driver, abandon ref to about to be disposed embedded storage.
Change-Id: I6bfce155151b79cd0a1707744e79298b45d8752b
diff --git a/connectivity/source/drivers/firebird/Connection.cxx b/connectivity/source/drivers/firebird/Connection.cxx
index 69b2377..1ad4f44 100644
--- a/connectivity/source/drivers/firebird/Connection.cxx
+++ b/connectivity/source/drivers/firebird/Connection.cxx
@@ -679,6 +679,9 @@ void SAL_CALL Connection::documentEventOccured( const DocumentEvent& _Event )
void SAL_CALL Connection::disposing(const EventObject& /*rSource*/)
throw (RuntimeException, std::exception)
{
+ MutexGuard aGuard( m_aMutex );
+
+ m_xEmbeddedStorage.clear();
}
void Connection::buildTypeInfo() throw( SQLException)
commit 814818c3451fa32900c011278e2e5b62e3518eb0
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date: Sat Jun 28 16:47:21 2014 +0200
firebird: enable-debug cause trouble due to a lifecycle management issue
firebird in debug mode abort() on lo shutdown due to a lifcycle management
issue where firebord try to create a directory in a temp directory that
is not there anymore, and then exception for it and
that exception in debug mode cause an abort.
Change-Id: Iabbd6ffda34a84e5b0d8e44761226083c8c1d168
diff --git a/external/firebird/ExternalProject_firebird.mk b/external/firebird/ExternalProject_firebird.mk
index 6e3f582..d25c667 100644
--- a/external/firebird/ExternalProject_firebird.mk
+++ b/external/firebird/ExternalProject_firebird.mk
@@ -50,7 +50,6 @@ $(call gb_ExternalProject_get_state_target,firebird,build):
--without-editline \
--disable-superserver \
--with-system-icu --without-fbsample --without-fbsample-db \
- $(if $(filter TRUE,$(ENABLE_DEBUG)),--enable-debug) \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
$(if $(filter IOS ANDROID,$(OS)),--disable-shared,--disable-static) \
&& $(if $(filter WNT,$(OS)),\
More information about the Libreoffice-commits
mailing list