Kaydet (Commit) f92b087f authored tarafından Michael Stahl's avatar Michael Stahl

fix double free in SwXTextView::removeSelectionChangeListener

dbaccess_complex segfaults because ptr_vector::erase actually deletes
the element; also, a std::vector is more appropriate to store smart ptr.
(regression from 8533a191)
üst b856ea5a
......@@ -56,7 +56,7 @@ class SdrObject;
class SwView;
typedef ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionChangeListener > XSelectionChangeListenerRef;
typedef boost::ptr_vector<XSelectionChangeListenerRef> SelectionChangeListenerArr;
typedef std::vector<XSelectionChangeListenerRef> SelectionChangeListenerArr;
class SwXTextView :
public ::com::sun::star::view::XSelectionSupplier,
......
......@@ -606,9 +606,7 @@ void SwXTextView::addSelectionChangeListener(
throw( uno::RuntimeException )
{
SolarMutexGuard aGuard;
uno::Reference< view::XSelectionChangeListener > * pInsert = new uno::Reference< view::XSelectionChangeListener > ;
*pInsert = rxListener;
aSelChangedListeners.push_back(pInsert);
aSelChangedListeners.push_back(rxListener);
}
void SwXTextView::removeSelectionChangeListener(
......@@ -625,7 +623,6 @@ void SwXTextView::removeSelectionChangeListener(
if(pLeft == pRight)
{
aSelChangedListeners.erase(it);
delete pElem;
break;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment