+inline void UninstallRootMessage( UpdateManager& manager, const Layer* constRoot )
+{
+ // Scene graph thread can destroy this object.
+ Layer* root = const_cast< Layer* >( constRoot );
+
+ typedef MessageValue1< UpdateManager, Layer* > LocalType;
+
+ // Reserve some memory inside the message queue
+ uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+
+ // Construct message in the message queue memory; note that delete should not be called on the return value
+ new (slot) LocalType( &manager, &UpdateManager::UninstallRoot, root );
+}
+