+
+void TextureManager::AddObserver( TextureManager::LifecycleObserver& observer )
+{
+ // make sure an observer doesn't observe the same object twice
+ // otherwise it will get multiple calls to ObjectDestroyed()
+ DALI_ASSERT_DEBUG( mLifecycleObservers.End() == std::find( mLifecycleObservers.Begin(), mLifecycleObservers.End(), &observer));
+ mLifecycleObservers.PushBack( &observer );
+}
+
+void TextureManager::RemoveObserver( TextureManager::LifecycleObserver& observer)
+{
+ // Find the observer...
+ auto endIter = mLifecycleObservers.End();
+ for( auto iter = mLifecycleObservers.Begin(); iter != endIter; ++iter)
+ {
+ if( (*iter) == &observer)
+ {
+ mLifecycleObservers.Erase( iter );
+ break;
+ }
+ }
+ DALI_ASSERT_DEBUG(endIter != mLifecycleObservers.End());
+}
+
+