diff options
author | David Robillard <d@drobilla.net> | 2014-12-18 04:03:39 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-12-18 04:03:39 -0500 |
commit | 7eab4c6f339777a0e5bd202ff851bdce466cb183 (patch) | |
tree | e6d1aa290052628158f101455688ae052f23d56f /libs/ardour/source_factory.cc | |
parent | e584ae0bf94673bf719e661c49e8a2f2d2dd0346 (diff) |
Don't assume compiler can avoid copy to const ref.
Diffstat (limited to 'libs/ardour/source_factory.cc')
-rw-r--r-- | libs/ardour/source_factory.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libs/ardour/source_factory.cc b/libs/ardour/source_factory.cc index 4005148564..4b4a3cba33 100644 --- a/libs/ardour/source_factory.cc +++ b/libs/ardour/source_factory.cc @@ -205,7 +205,8 @@ SourceFactory::create (Session& s, const XMLNode& node, bool defer_peaks) } } else if (type == DataType::MIDI) { boost::shared_ptr<SMFSource> src (new SMFSource (s, node)); - src->load_model (Glib::Threads::Mutex::Lock(src->mutex()), true); + Source::Lock lock(src->mutex()); + src->load_model (lock, true); #ifdef BOOST_SP_ENABLE_DEBUG_HOOKS // boost_debug_shared_ptr_mark_interesting (src, "Source"); #endif @@ -273,7 +274,8 @@ SourceFactory::createExternal (DataType type, Session& s, const string& path, } else if (type == DataType::MIDI) { boost::shared_ptr<SMFSource> src (new SMFSource (s, path)); - src->load_model (Glib::Threads::Mutex::Lock(src->mutex()), true); + Source::Lock lock(src->mutex()); + src->load_model (lock, true); #ifdef BOOST_SP_ENABLE_DEBUG_HOOKS // boost_debug_shared_ptr_mark_interesting (src, "Source"); #endif @@ -324,7 +326,8 @@ SourceFactory::createWritable (DataType type, Session& s, const std::string& pat boost::shared_ptr<SMFSource> src (new SMFSource (s, path, SndFileSource::default_writable_flags)); assert (src->writable ()); - src->load_model (Glib::Threads::Mutex::Lock(src->mutex()), true); + Source::Lock lock(src->mutex()); + src->load_model (lock, true); #ifdef BOOST_SP_ENABLE_DEBUG_HOOKS // boost_debug_shared_ptr_mark_interesting (src, "Source"); #endif |