mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-03 12:19:33 +01:00
Fix stackoverflow, endless recursion on ComparableSharedPtr assignment
boost::shared_ptr & operator=(shared_ptr const & r); is not declared virtual and cannot safely be overloaded.
This commit is contained in:
parent
a92dddda25
commit
dc0037230e
1 changed files with 4 additions and 1 deletions
|
|
@ -42,7 +42,10 @@ class /*LIBARDOUR_API*/ ComparableSharedPtr : public boost::shared_ptr<T>
|
|||
|
||||
ComparableSharedPtr (ComparableSharedPtr const & r) : boost::shared_ptr<T> (r) {}
|
||||
|
||||
ComparableSharedPtr& operator=(const ComparableSharedPtr& r) { *this = r; return *this; }
|
||||
ComparableSharedPtr& operator=(ComparableSharedPtr const& r) BOOST_SP_NOEXCEPT {
|
||||
boost::shared_ptr<T>(r).swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<class Y>
|
||||
ComparableSharedPtr(ComparableSharedPtr<Y> const & r) : boost::shared_ptr<T> (r) {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue