diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-05-26 10:57:26 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-05-26 11:57:50 +0100 |
commit | e55f83e1731e1031c63d8463b57c434cceb126e3 (patch) | |
tree | fcaece920b33382eb8d95f5648e939ee937f61e6 /dbaccess | |
parent | 77829f9221c1d9c9747304c90a0ceb8a16864a26 (diff) |
Resolves: tdf#97854 crash on deleting inner join relationship
seems to be a regression from...
commit 356bc0f697299e5fb6156ce25dc69845eaa6f9e6
Author: Michael Meeks <michael.meeks@collabora.com>
Date: Wed Jul 1 19:03:55 2015 +0100
tdf#92434 - fix iteration, and remember to disposeAndClear.
which is part of the VclPtr stuff
so hold the connection by VclPtr when removing it from m_vTableConnection
and only call dispose on it when _bDelete is true, not always.
Change-Id: I38e65c6928499dc1e8bbf6b71e9901a4eaa5d913
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/querydesign/JoinTableView.cxx | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx index 4dd4fff2268d..340f91abebff 100644 --- a/dbaccess/source/ui/querydesign/JoinTableView.cxx +++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx @@ -244,27 +244,24 @@ sal_uLong OJoinTableView::GetTabWinCount() bool OJoinTableView::RemoveConnection( OTableConnection* _pConn, bool _bDelete ) { - DeselectConn(_pConn); + VclPtr<OTableConnection> xConn(_pConn); + + DeselectConn(xConn); // to force a redraw - _pConn->InvalidateConnection(); + xConn->InvalidateConnection(); - m_pView->getController().removeConnectionData( _pConn->GetData() ); + m_pView->getController().removeConnectionData(xConn->GetData()); - auto it = ::std::find(m_vTableConnection.begin(),m_vTableConnection.end(),_pConn); - if (it != m_vTableConnection.end()) - { - it->disposeAndClear(); - m_vTableConnection.erase( it ); - } + m_vTableConnection.erase(std::find(m_vTableConnection.begin(), m_vTableConnection.end(), xConn)); modified(); if ( m_pAccessible ) m_pAccessible->notifyAccessibleEvent( AccessibleEventId::CHILD, - makeAny(_pConn->GetAccessible()), + makeAny(xConn->GetAccessible()), Any()); - if ( _bDelete ) - _pConn->disposeOnce(); + if (_bDelete) + xConn->disposeOnce(); return true; } |