13
0

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:
Robin Gareus 2019-12-12 03:57:58 +01:00
parent a92dddda25
commit dc0037230e
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -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) {}