diff options
author | Florian Jung <flo@windfisch.org> | 2013-09-02 15:56:21 +0200 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2013-09-02 15:56:21 +0200 |
commit | 31ffcde6e49564575f4452ee32640b69d0177ada (patch) | |
tree | 609fe58214c8e7c702cc55837fb14c40883ad04c | |
parent | 724f552586702a7189ac30553bcbcd0fed0e6f84 (diff) |
complain when chaining an already chained part
-rw-r--r-- | muse2/muse/part.cpp | 7 |
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; |