summaryrefslogtreecommitdiff
path: root/muse2
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2013-09-02 15:56:21 +0200
committerFlorian Jung <flo@windfisch.org>2013-09-02 15:56:21 +0200
commit31ffcde6e49564575f4452ee32640b69d0177ada (patch)
tree609fe58214c8e7c702cc55837fb14c40883ad04c /muse2
parent724f552586702a7189ac30553bcbcd0fed0e6f84 (diff)
complain when chaining an already chained part
Diffstat (limited to 'muse2')
-rw-r--r--muse2/muse/part.cpp7
1 files changed, 6 insertions, 1 deletions
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;