From 23a615a6dbf84a47ca3dbdb2b1f4a382cf6c0820 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 21 May 2012 10:26:10 +0000 Subject: Must disconnect old UnscopedConnection when setting a new one in operator=, otherwise the old one is leaked. git-svn-id: svn://localhost/ardour2/branches/3.0@12356 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/pbd/pbd/signals.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libs') diff --git a/libs/pbd/pbd/signals.h b/libs/pbd/pbd/signals.h index e20a126163..dc53b31f94 100644 --- a/libs/pbd/pbd/signals.h +++ b/libs/pbd/pbd/signals.h @@ -110,6 +110,11 @@ public: ScopedConnection& operator= (UnscopedConnection const & o) { + if (_c == o) { + return *this; + } + + disconnect (); _c = o; return *this; } -- cgit v1.2.3