for(;iter!=endIter;++iter)
{
(*iter)->OnDestroy();
- delete(*iter);
+ Node::Delete(*iter);
}
// If there is root, reset it, otherwise do nothing as rendering was never started
{
root->OnDestroy();
- delete root;
+ Node::Delete( root );
root = NULL;
}
{
systemLevelRoot->OnDestroy();
- delete systemLevelRoot;
+ Node::Delete( systemLevelRoot );
systemLevelRoot = NULL;
}
if( textureSet == mImpl->textureSets[i] )
{
mImpl->textureSets.Remove( mImpl->textureSets.Begin() + i );
+
+ // Update manager has ownership of the TextureSet
+ delete textureSet;
return;
}
}
//Process Touches & Gestures
const bool gestureUpdated = ProcessGestures( bufferIndex, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds );
- const bool updateScene = // The scene-graph requires an update if..
+ bool updateScene = // The scene-graph requires an update if..
(mImpl->nodeDirtyFlags & RenderableUpdateFlags) || // ..nodes were dirty in previous frame OR
IsAnimationRunning() || // ..at least one animation is running OR
mImpl->messageQueue.IsSceneUpdateRequired() || // ..a message that modifies the scene graph node tree is queued OR
mImpl->transformManager.ResetToBaseValue();
}
- //Process the queued scene messages
- mImpl->messageQueue.ProcessMessages( bufferIndex );
+ // Process the queued scene messages. Note, MessageQueue::FlushQueue may be called
+ // between calling IsSceneUpdateRequired() above and here, so updateScene should
+ // be set again
+ updateScene |= mImpl->messageQueue.ProcessMessages( bufferIndex );
//Post Process Ids of resources updated by renderer
mImpl->resourceManager.PostProcessResources( bufferIndex );