summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/comparable_shared_ptr.h
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-12-12 03:57:58 +0100
committerRobin Gareus <robin@gareus.org>2019-12-12 03:57:58 +0100
commitdc0037230eeae60fef66dbf8a8aeab95299e460b (patch)
tree55fe19f34f2310326ce69aa4cb84703bea341dcd /libs/ardour/ardour/comparable_shared_ptr.h
parenta92dddda256ca55b49fc6de6d2ba657816cd5b67 (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.h5
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) {}