diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-07-01 19:03:55 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-08-06 12:52:56 +0200 |
commit | 21aee98e4037354d346163ca570354894fe85dcb (patch) | |
tree | 853dc72d1f6529583f4372377572b13a4e1ddf76 /dbaccess | |
parent | ee70923a58de32f15da9a644f6dd62bfe232bd18 (diff) |
tdf#92434 - fix iteration, and remember to disposeAndClear.
Change-Id: Id9c7b33689ea51a18394a96acbb9c08d67992942
Reviewed-on: https://gerrit.libreoffice.org/16671
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/16685
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/querydesign/JoinTableView.cxx | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx index 571067e061d6..7beabafab09c 100644 --- a/dbaccess/source/ui/querydesign/JoinTableView.cxx +++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx @@ -246,7 +246,7 @@ sal_uLong OJoinTableView::GetTabWinCount() return m_aTableMap.size(); } -bool OJoinTableView::RemoveConnection( OTableConnection* _pConn,bool _bDelete ) +bool OJoinTableView::RemoveConnection( OTableConnection* _pConn, bool _bDelete ) { DeselectConn(_pConn); @@ -255,8 +255,12 @@ bool OJoinTableView::RemoveConnection( OTableConnection* _pConn,bool _bDelete ) m_pView->getController().removeConnectionData( _pConn->GetData() ); - m_vTableConnection.erase( - ::std::find(m_vTableConnection.begin(),m_vTableConnection.end(),_pConn) ); + auto it = ::std::find(m_vTableConnection.begin(),m_vTableConnection.end(),_pConn); + if (it != m_vTableConnection.end()) + { + it->disposeAndClear(); + m_vTableConnection.erase( it ); + } modified(); if ( m_pAccessible ) @@ -983,10 +987,13 @@ void OJoinTableView::ClearAll() HideTabWins(); // and the same with the Connections - auto aIter = m_vTableConnection.begin(); - auto aEnd = m_vTableConnection.end(); - for(;aIter != aEnd;++aIter) - RemoveConnection( *aIter ,true); + while(true) + { + auto aIter = m_vTableConnection.begin(); + if (aIter == m_vTableConnection.end()) + break; + RemoveConnection(*aIter, true); + } m_vTableConnection.clear(); m_pLastFocusTabWin = NULL; |