- if( *iter == samplerDataProvider )
- {
- found = true;
- break;
- }
- }
-
- if( found )
- {
- Sampler* mutableSampler = const_cast<Sampler*>(sampler);
- mutableSampler->RemoveConnectionObserver( *this );
- mutableSampler->RemoveUniformMapObserver( *this );
- mSamplers.Erase(iter);
+ sampler->RemoveConnectionObserver( *this );
+ sampler->RemoveUniformMapObserver( *this );
+ mSamplers.Erase( match );