summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/svx/gridctrl.hxx2
-rw-r--r--svx/source/fmcomp/gridctrl.cxx10
2 files changed, 4 insertions, 8 deletions
diff --git a/include/svx/gridctrl.hxx b/include/svx/gridctrl.hxx
index 80c2b6aad5ff..32bbd965b579 100644
--- a/include/svx/gridctrl.hxx
+++ b/include/svx/gridctrl.hxx
@@ -255,7 +255,7 @@ private:
void* m_pFieldListeners;
// property listeners for field values
- DisposeListenerGridBridge* m_pCursorDisposeListener;
+ std::unique_ptr<DisposeListenerGridBridge> m_pCursorDisposeListener;
// need to know about the diposing of the seek cursor
// construct analogous to the data source proplistener/multiplexer above :
// DisposeListenerGridBridge is a bridge from FmXDisposeListener which I don't want to be derived from
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index 8093bddd31b9..97d156337440 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -1013,11 +1013,7 @@ void DbGridControl::dispose()
osl::MutexGuard aGuard(m_aDestructionSafety);
if (m_pFieldListeners)
DisconnectFromFields();
- if (m_pCursorDisposeListener)
- {
- delete m_pCursorDisposeListener;
- m_pCursorDisposeListener = nullptr;
- }
+ m_pCursorDisposeListener.reset();
}
if (m_nDeleteEvent)
@@ -1442,7 +1438,7 @@ void DbGridControl::setDataSource(const Reference< XRowSet >& _xCursor, DbGridCo
RemoveRows();
DisconnectFromFields();
- DELETEZ(m_pCursorDisposeListener);
+ m_pCursorDisposeListener.reset();
{
::osl::MutexGuard aGuard(m_aAdjustSafety);
@@ -1640,7 +1636,7 @@ void DbGridControl::setDataSource(const Reference< XRowSet >& _xCursor, DbGridCo
// start listening on the seek cursor
if (m_pSeekCursor)
- m_pCursorDisposeListener = new DisposeListenerGridBridge(*this, Reference< XComponent > (Reference< XInterface >(*m_pSeekCursor), UNO_QUERY));
+ m_pCursorDisposeListener.reset(new DisposeListenerGridBridge(*this, Reference< XComponent > (Reference< XInterface >(*m_pSeekCursor), UNO_QUERY)));
}
void DbGridControl::RemoveColumns()