diff options
Diffstat (limited to 'connectivity/source/drivers/postgresql/pq_connection.cxx')
-rw-r--r-- | connectivity/source/drivers/postgresql/pq_connection.cxx | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/connectivity/source/drivers/postgresql/pq_connection.cxx b/connectivity/source/drivers/postgresql/pq_connection.cxx index ebe1aaac52f2..214f08c47b7d 100644 --- a/connectivity/source/drivers/postgresql/pq_connection.cxx +++ b/connectivity/source/drivers/postgresql/pq_connection.cxx @@ -96,28 +96,24 @@ namespace pq_sdbc_driver // Helper class for statement lifetime management class ClosableReference : public cppu::WeakImplHelper< com::sun::star::uno::XReference > { - Connection *m_conn; + css::uno::Reference<Connection> m_conn; ::rtl::ByteSequence m_id; public: ClosableReference( const ::rtl::ByteSequence & id , Connection *that ) : m_conn( that ), m_id( id ) { - that->acquire(); } virtual ~ClosableReference() { - if( m_conn ) - m_conn->release(); } virtual void SAL_CALL dispose() throw (std::exception) override { - if( m_conn ) + if( m_conn.is() ) { m_conn->removeFromWeakMap(m_id); - m_conn->release(); - m_conn = nullptr; + m_conn.clear(); } } }; |