//-----------------------------------------------------------------------
	void RibbonTrailRenderer::_destroyAll(void)
	{
		if (!mParentTechnique)
			return;

		// Remove the listener
		mParentTechnique->removeTechniqueListener(this);
		
		// Detach the Ribbontrail
		if (mChildNode && mTrail && mTrail->isAttached())
		{
			mChildNode->detachObject(mTrail);
		}

		// Delete the Ribbontrail
		Ogre::SceneManager* sceneManager = mParentTechnique->getParentSystem()->getSceneManager();
		if (mTrail && sceneManager && sceneManager->hasRibbonTrail(mRibbonTrailName))
		{
			sceneManager->destroyRibbonTrail(mRibbonTrailName);
			mTrail = 0;
		}

		// Delete the visual data
		vector<RibbonTrailRendererVisualData*>::const_iterator it;
		vector<RibbonTrailRendererVisualData*>::const_iterator itEnd = mAllVisualData.end();
		for (it = mAllVisualData.begin(); it != itEnd; ++it)
		{
			PU_DELETE_T(*it, RibbonTrailRendererVisualData, MEMCATEGORY_SCENE_OBJECTS);
		}

		mAllVisualData.clear();
		mVisualData.clear();

		// Reset the visual data in the pool
		mParentTechnique->initVisualDataInPool();

		// Destroy the children of the childnode, but not the childnode itself, because this gives a delete-order problem
		if (mChildNode)
		{
			mChildNode->removeAndDestroyAllChildren();
		}
	}