SAN + virtual source: segfault fixed (MB #9737)

When moving the slow sync setting into SyncSource, I didn't adapt
the lookup of the virtual sources. SourceList was inconsistent in
that it could only look up normal sources by name. Fixing this
inconsistency solves the sefault.
This commit is contained in:
Patrick Ohly 2010-02-16 08:38:05 +01:00
parent f93b323150
commit 8823e54b20

View file

@ -1124,13 +1124,18 @@ public:
}
}
/** find sync source by name (only normal sources, not virtual ones) */
/** find sync source by name (both normal and virtual sources) */
SyncSource *operator [] (const string &name) {
BOOST_FOREACH(SyncSource *source, *this) {
if (name == source->getName()) {
return source;
}
}
BOOST_FOREACH(boost::shared_ptr<VirtualSyncSource> &source, m_virtualSources) {
if (name == source->getName()) {
return source.get();
}
}
return NULL;
}