diff options
-rw-r--r-- | connectivity/source/drivers/firebird/Connection.cxx | 8 | ||||
-rw-r--r-- | dbaccess/qa/unit/firebird.cxx | 4 |
2 files changed, 11 insertions, 1 deletions
diff --git a/connectivity/source/drivers/firebird/Connection.cxx b/connectivity/source/drivers/firebird/Connection.cxx index 40ed35ad4112..dfda365d7970 100644 --- a/connectivity/source/drivers/firebird/Connection.cxx +++ b/connectivity/source/drivers/firebird/Connection.cxx @@ -55,6 +55,7 @@ #include <comphelper/processfactory.hxx> #include <comphelper/storagehelper.hxx> #include <unotools/tempfile.hxx> +#include <unotools/localfilehelper.hxx> #include <unotools/ucbstreamhelper.hxx> using namespace connectivity::firebird; @@ -166,7 +167,6 @@ void Connection::construct(const ::rtl::OUString& url, const Sequence< PropertyV bIsNewDatabase = !m_xEmbeddedStorage->hasElements(); m_pExtractedFDBFile.reset(new ::utl::TempFile(NULL, true)); - m_pExtractedFDBFile->EnableKillingFile(); m_sFirebirdURL = m_pExtractedFDBFile->GetFileName() + "/firebird.fdb"; SAL_INFO("connectivity.firebird", "Temporary .fdb location: " << m_sFirebirdURL); @@ -785,6 +785,12 @@ void Connection::disposing() dispose_ChildImpl(); cppu::WeakComponentImplHelperBase::disposing(); m_xDriver.clear(); + + if (m_pExtractedFDBFile) + { + ::utl::removeTree(m_pExtractedFDBFile->GetURL()); + m_pExtractedFDBFile.reset(); + } } void Connection::disposeStatements() diff --git a/dbaccess/qa/unit/firebird.cxx b/dbaccess/qa/unit/firebird.cxx index 61c2a3c81500..424c0cdccf58 100644 --- a/dbaccess/qa/unit/firebird.cxx +++ b/dbaccess/qa/unit/firebird.cxx @@ -54,6 +54,8 @@ void FirebirdTest::testEmptyDBConnection() getDocumentForFileName("firebird_empty.odb"); getConnectionForDocument(xDocument); + + closeDocument(uno::Reference<lang::XComponent>(xDocument, uno::UNO_QUERY)); } /** @@ -93,6 +95,8 @@ void FirebirdTest::testIntegerDatabase() xRow->getString(xColumnLocate->findColumn("_VARCHAR"))); CPPUNIT_ASSERT(!xResultSet->next()); // Should only be one row + + closeDocument(uno::Reference<lang::XComponent>(xDocument, uno::UNO_QUERY)); } CPPUNIT_TEST_SUITE_REGISTRATION(FirebirdTest); |