diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-10-21 14:03:05 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-10-21 15:08:57 +0200 |
commit | 820e64f96615f46ac97762357d0369615967dbdb (patch) | |
tree | 928032ba0ccd82beb34bbec5b331fddc543f4179 /connectivity | |
parent | a2e4d4329bc3913a198c25c428faedef02f36681 (diff) |
connectivity: firebird: fix temp directory leak
Dispose the dbaccess document, and recursively delete the temp directory
in Connection::dispose().
Change-Id: Id283289e44b8ca09b88da19920da7f27b551aa7e
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/firebird/Connection.cxx | 8 |
1 files changed, 7 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() |