From dc0037230eeae60fef66dbf8a8aeab95299e460b Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 12 Dec 2019 03:57:58 +0100 Subject: [PATCH] Fix stackoverflow, endless recursion on ComparableSharedPtr assignment boost::shared_ptr & operator=(shared_ptr const & r); is not declared virtual and cannot safely be overloaded. --- libs/ardour/ardour/comparable_shared_ptr.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 ComparableSharedPtr (ComparableSharedPtr const & r) : boost::shared_ptr (r) {} - ComparableSharedPtr& operator=(const ComparableSharedPtr& r) { *this = r; return *this; } + ComparableSharedPtr& operator=(ComparableSharedPtr const& r) BOOST_SP_NOEXCEPT { + boost::shared_ptr(r).swap(*this); + return *this; + } template ComparableSharedPtr(ComparableSharedPtr const & r) : boost::shared_ptr (r) {}