From 31ffcde6e49564575f4452ee32640b69d0177ada Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Mon, 2 Sep 2013 15:56:21 +0200 Subject: complain when chaining an already chained part --- muse2/muse/part.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/muse2/muse/part.cpp b/muse2/muse/part.cpp index 82427d28..1d246c50 100644 --- a/muse2/muse/part.cpp +++ b/muse2/muse/part.cpp @@ -63,8 +63,13 @@ void Part::unchainClone() void Part::chainClone(Part* p) { // FIXME assertion + assert(p); - this->unchainClone(); + if (! (_prevClone==this && _nextClone==this)) // the part is still part of a clone chain! + { + printf("ERROR: THIS SHOULD NEVER HAPPEN: Part::chainClone() called, but part is already chained! I'll unchain for now, but better fix that!\n"); + this->unchainClone(); + } // Make our links to the chain this->_prevClone = p; -- cgit v1.2.1