From 8823e54b20fb200f19fefeff4a3cd37f8d2f1e88 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Tue, 16 Feb 2010 08:38:05 +0100 Subject: [PATCH] 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. --- src/syncevo/SyncContext.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/syncevo/SyncContext.cpp b/src/syncevo/SyncContext.cpp index fc7bbe4f..ca8a6cdf 100644 --- a/src/syncevo/SyncContext.cpp +++ b/src/syncevo/SyncContext.cpp @@ -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 &source, m_virtualSources) { + if (name == source->getName()) { + return source.get(); + } + } return NULL; }