summaryrefslogtreecommitdiff
path: root/muse2/muse/part.cpp
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2011-12-21 17:39:57 +0000
committerFlorian Jung <flo@windfisch.org>2011-12-21 17:39:57 +0000
commit1057d7190242cdf9248671b316a398db805f5f56 (patch)
treeab50268a7db2f80cfb45a7ad6578fe735ab84ce5 /muse2/muse/part.cpp
parent9977c7114089b8708d310268833b83343caa0fd1 (diff)
parentc36a5508aa42e596b005425208054af9a60734b4 (diff)
merged with trunk (that is, pulled the fixes from release_2_0)
only quickly tested, seems okay on the first glance
Diffstat (limited to 'muse2/muse/part.cpp')
-rw-r--r--muse2/muse/part.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/muse2/muse/part.cpp b/muse2/muse/part.cpp
index 6407dadc..33519e11 100644
--- a/muse2/muse/part.cpp
+++ b/muse2/muse/part.cpp
@@ -23,7 +23,6 @@
//=========================================================
#include <stdio.h>
-#include <assert.h>
#include <cmath>
#include "song.h"
@@ -39,7 +38,7 @@
namespace MusECore {
-int Part::snGen;
+int Part::snGen=0;
//---------------------------------------------------------
// unchainClone
@@ -751,6 +750,18 @@ WavePart::WavePart(const WavePart& p) : Part(p)
Part::~Part()
{
+ if (_prevClone!=this || _nextClone!=this)
+ {
+ printf("THIS MIGHT BE A HINT FOR BUGS: Part isn't unchained in ~Part()! i'll do that now. this is\n"
+ "not an actual bug, actually that manual unchain should be unneccessary if this was coded\n"
+ "properly. but as it wasn't, and the unchain was always done manually, this might be an\n"
+ "indicator that it have been forgotten. either your computer will explode in 3..2..1..now,\n"
+ "or you can ignore this message.\n"
+ "\n");
+
+ unchainClone(this);
+ }
+
_events->incRef(-1);
if (_events->refCount() <= 0)
delete _events;
@@ -805,7 +816,8 @@ void PartList::remove(Part* part)
break;
}
}
- assert(i != end());
+ if (i == end())
+ printf("THIS SHOULD NEVER HAPPEN: could not find the part in PartList::remove()!\n");
}
//---------------------------------------------------------