diff options
author | Robin Gareus <robin@gareus.org> | 2019-12-12 03:57:58 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-12-12 03:57:58 +0100 |
commit | dc0037230eeae60fef66dbf8a8aeab95299e460b (patch) | |
tree | 55fe19f34f2310326ce69aa4cb84703bea341dcd /libs/ardour/ardour/comparable_shared_ptr.h | |
parent | a92dddda256ca55b49fc6de6d2ba657816cd5b67 (diff) |
Fix stackoverflow, endless recursion on ComparableSharedPtr assignment
boost::shared_ptr & operator=(shared_ptr const & r);
is not declared virtual and cannot safely be overloaded.
Diffstat (limited to 'libs/ardour/ardour/comparable_shared_ptr.h')
-rw-r--r-- | libs/ardour/ardour/comparable_shared_ptr.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/ardour/ardour/comparable_shared_ptr.h b/libs/ardour/ardour/comparable_shared_ptr.h index 32cdfc21a2..a49481fe08 100644 --- a/libs/ardour/ardour/comparable_shared_ptr.h +++ b/libs/ardour/ardour/comparable_shared_ptr.h @@ -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) {} |