Beispiel #1
0
GRGlobalStem::~GRGlobalStem()
{
	// we just remove any association manually
	if (mAssociated)
	{
		GuidoPos pos = mAssociated->GetHeadPosition();
		while(pos)
		{
			GRNotationElement * el = mAssociated->GetNext(pos);
			if( el ) el->removeAssociation(this);
		}
	}
	if (mFirstEl)
	{
		mFirstEl->removeAssociation(this);
	}

	delete theStem;	theStem = 0;
	delete theFlag; theFlag = 0;
//	if (colref)	delete [] colref;
}
GRNotationElement::~GRNotationElement()
{
	// here, we need to tell "a" spring, that
	// the element no longer belongs ...
	// this is important for newlines that happen
	// after the graphic-elements have been created ...

	if (mAssociated)
	{
		GuidoPos pos = mAssociated->GetHeadPosition();
		GRNotationElement * el;
		while (pos)
		{
			el = mAssociated->GetNext(pos);
			if (el)
				el->removeAssociation(this);

		}  
		delete mAssociated;
		mAssociated = 0;
  } 
  // previously: no delete only set to NULL ... associated = NULL;
}