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
@ -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…
Reference in New Issue
Block a user