//--------------------------------------------------------------------- void ResourceBackgroundQueue::shutdown() { WorkQueue* wq = Root::getSingleton().getWorkQueue(); wq->abortRequestsByChannel(mWorkQueueChannel); wq->removeRequestHandler(mWorkQueueChannel, this); wq->removeResponseHandler(mWorkQueueChannel, this); }
//--------------------------------------------------------------------- Page::~Page() { WorkQueue* wq = Root::getSingleton().getWorkQueue(); wq->removeRequestHandler(mWorkQueueChannel, this); wq->removeResponseHandler(mWorkQueueChannel, this); destroyAllContentCollections(); if (mDebugNode) { // destroy while we have the chance SceneNode::ObjectIterator it = mDebugNode->getAttachedObjectIterator(); while(it.hasMoreElements()) mParent->getSceneManager()->destroyMovableObject(it.getNext()); mDebugNode->removeAndDestroyAllChildren(); mParent->getSceneManager()->destroySceneNode(mDebugNode); mDebugNode = 0; } }
//--------------------------------------------------------------------- TerrainPagedWorldSection::~TerrainPagedWorldSection() { //remove the pending tasks, but keep the front one, as it may have been in running if(!mPagesInLoading.empty()) mPagesInLoading.erase( ++mPagesInLoading.begin(), mPagesInLoading.end() ); while(!mPagesInLoading.empty()) { OGRE_THREAD_SLEEP(50); Root::getSingleton().getWorkQueue()->processResponses(); } WorkQueue* wq = Root::getSingleton().getWorkQueue(); wq->removeRequestHandler(mWorkQueueChannel, this); wq->removeResponseHandler(mWorkQueueChannel, this); OGRE_DELETE mTerrainGroup; if(mTerrainDefiner) OGRE_DELETE mTerrainDefiner; }