void PlayerManager::RestartAllThreads() { printf("Restarting all threads\n"); TimeNode *rootNode = NULL; list<TimeThread*>::iterator it = _threads.begin(); for (; it != _threads.end(); it++) { TimeThread *thread = *it; if (thread->IsRootThread()) { rootNode = thread->GetHead(); it = EraseThread(thread); delete thread; } else { TimeThread *t1, *t2; thread = TimeThread::Reunite(thread, t2, _scene); _threads.push_back(thread); it = EraseThread(t1); it = EraseThread(t2); delete t1; delete t2; } } if (rootNode) { DeleteSubtree(rootNode); } TimeNode *node = new TimeNode(sf::Vector2f(100.f,100.f)); _playThread = new TimeThread(node, _scene); _threads.push_back(_playThread); _playThread->EnableInput(); }
void GPTree::DeleteSubtree( GPTreeNode* subtree ) { for( int i = 0; i < GP_MAX_PARAMETERS; ++i ) { if ( subtree->parameters[ i ] ) DeleteSubtree( subtree->parameters[ i ] ); } delete subtree; }
GPTree::~GPTree() { DeleteSubtree( m_root ); }